采购大量修改

This commit is contained in:
shawnzhang 2019-04-20 20:06:45 +08:00
parent b1633d5353
commit fe7d513b78
81 changed files with 12102 additions and 1182 deletions

File diff suppressed because one or more lines are too long

View file

@ -230,6 +230,17 @@ const reg = /^[A-Z0-9]{2}$/
} }
// 8-20位含数字、字母大小写三种组合方式的密码 // 8-20位含数字、字母大小写三种组合方式的密码
(?![0-9A-Z]+$)(?![0-9a-z]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$ (?![0-9A-Z]+$)(?![0-9a-z]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$
```
###### 递归函数
```js
// 递归函数
recursion(val){
if (val.level === 1) {
return val.data
} else {
return this.recursion(val.parent)
}
}
``` ```
###### 完成进度 ###### 完成进度
```text ```text

View file

@ -113,8 +113,8 @@ export function createnewproduct(query) {
if (query.categoryid !== '' && query.categoryid !== null && query.categoryid !== undefined) { if (query.categoryid !== '' && query.categoryid !== null && query.categoryid !== undefined) {
params.append('categoryid', query.categoryid) // 你要传给后台的参数值 key/value params.append('categoryid', query.categoryid) // 你要传给后台的参数值 key/value
} }
if (query.color !== '' && query.color !== null && query.color !== undefined) { if (query.colorId !== '' && query.colorId !== null && query.colorId !== undefined) {
params.append('color', query.color) // 你要传给后台的参数值 key/value params.append('colorId', query.colorId) // 你要传给后台的参数值 key/value
} }
if (query.brand !== '' && query.brand !== null && query.brand !== undefined) { if (query.brand !== '' && query.brand !== null && query.brand !== undefined) {
params.append('brand', query.brand) // 你要传给后台的参数值 key/value params.append('brand', query.brand) // 你要传给后台的参数值 key/value
@ -307,6 +307,12 @@ export function deleteproduct(query) {
// 修改商品 // 修改商品
export function editproduct(query) { export function editproduct(query) {
var params = new URLSearchParams() var params = new URLSearchParams()
if (query.productid !== '' && query.productid !== null && query.productid !== undefined) {
params.append('productid', query.productid) // 你要传给后台的参数值 key/value
}
if (query.isBatch !== '' && query.isBatch !== null && query.isBatch !== undefined) {
params.append('isBatch', query.isBatch) // 你要传给后台的参数值 key/value
}
if (query.effectiveDay !== '' && query.effectiveDay !== null && query.effectiveDay !== undefined) { if (query.effectiveDay !== '' && query.effectiveDay !== null && query.effectiveDay !== undefined) {
params.append('effectiveDay', query.effectiveDay) // 你要传给后台的参数值 key/value params.append('effectiveDay', query.effectiveDay) // 你要传给后台的参数值 key/value
} }

View file

@ -0,0 +1,13 @@
import request from '@/utils/request'
// 新建销售机会
export function addsaleopportunity(query, query2) {
var params = new URLSearchParams()
params.append('saleOpportunityJson', query) // 你要传给后台的参数值 key/value
params.append('saleOpportunityDetailJson', query2) // 你要传给后台的参数值 key/value
return request({
url: '/erp/saleopportunity/addsaleopportunity',
method: 'post',
data: params
})
}

View file

@ -1,11 +1,10 @@
import request from '@/utils/request' import request from '@/utils/request'
// 添加销售订单 // 添加销售订单
export function createsaleOrder(query, query2, query3, query4) { export function createsaleOrder(query, query2, query4) {
var params = new URLSearchParams() var params = new URLSearchParams()
params.append('Json', query) // 你要传给后台的参数值 key/value params.append('Json', query) // 你要传给后台的参数值 key/value
params.append('detailJson', query2) // 你要传给后台的参数值 key/value params.append('detailJson', query2) // 你要传给后台的参数值 key/value
params.append('costDetailJson', query3) // 你要传给后台的参数值 key/value
if (query4.repositoryId !== '' && query4.repositoryId !== null && query4.repositoryId !== undefined) { if (query4.repositoryId !== '' && query4.repositoryId !== null && query4.repositoryId !== undefined) {
params.append('repositoryId', query4.repositoryId) // 你要传给后台的参数值 key/value params.append('repositoryId', query4.repositoryId) // 你要传给后台的参数值 key/value
} }

100
src/api/SaleReturn.js Normal file
View file

@ -0,0 +1,100 @@
import request from '@/utils/request'
// 添加销售退货单
export function createsaleReturn(query, query2, query4) {
var params = new URLSearchParams()
params.append('Json', query) // 你要传给后台的参数值 key/value
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
if (query4.repositoryId !== '' && query4.repositoryId !== null && query4.repositoryId !== undefined) {
params.append('repositoryId', query4.repositoryId) // 你要传给后台的参数值 key/value
}
if (query4.regionId !== '' && query4.regionId !== null && query4.regionId !== undefined) {
params.append('regionId', query4.regionId) // 你要传给后台的参数值 key/value
}
return request({
url: '/erp/saleReturn/create',
method: 'post',
data: params
})
}
// 查询销售退货单
export function searchsaleReturn(query) {
var params = new URLSearchParams()
if (query.title !== '' && query.title !== null && query.title !== undefined) {
params.append('title', query.title) // 你要传给后台的参数值 key/value
}
if (query.number !== '' && query.number !== null && query.number !== undefined) {
params.append('number', query.number) // 你要传给后台的参数值 key/value
}
if (query.customerName !== '' && query.customerName !== null && query.customerName !== undefined) {
params.append('customerName', query.customerName) // 你要传给后台的参数值 key/value
}
if (query.payType !== '' && query.payType !== null && query.payType !== undefined) {
params.append('payType', query.payType) // 你要传给后台的参数值 key/value
}
if (query.judgeStat !== '' && query.judgeStat !== null && query.judgeStat !== undefined) {
params.append('judgeStat', query.judgeStat) // 你要传给后台的参数值 key/value
}
if (query.receiptStat !== '' && query.receiptStat !== null && query.receiptStat !== undefined) {
params.append('receiptStat', query.receiptStat) // 你要传给后台的参数值 key/value
}
if (query.beginTime !== '' && query.beginTime !== null && query.beginTime !== undefined) {
params.append('beginTime', query.beginTime) // 你要传给后台的参数值 key/value
}
if (query.endTime !== '' && query.endTime !== null && query.endTime !== undefined) {
params.append('endTime', query.endTime) // 你要传给后台的参数值 key/value
}
if (query.repositoryId !== '' && query.repositoryId !== null && query.repositoryId !== undefined) {
params.append('repositoryId', query.repositoryId) // 你要传给后台的参数值 key/value
}
if (query.createPersonId !== '' && query.createPersonId !== null && query.createPersonId !== undefined) {
params.append('createPersonId', query.createPersonId) // 你要传给后台的参数值 key/value
}
if (query.regionIds !== '' && query.regionIds !== null && query.regionIds !== undefined) {
params.append('regionIds', query.regionIds) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({
url: '/erp/saleReturn/search',
method: 'post',
data: params
})
}
// 修改销售退货单
export function updatesaleReturn(query, query2) {
var params = new URLSearchParams()
params.append('Json', query) // 你要传给后台的参数值 key/value
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
return request({
url: '/erp/saleReturn/update',
method: 'post',
data: params
})
}
// 删除销售退货单
export function deletesaleReturn(query) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('modelids', query) // 你要传给后台的参数值 key/value
}
return request({
url: '/erp/saleReturn/delete',
method: 'post',
data: params
})
}
// 审核销售退货单
export function updatesaleReturn2(query) {
var params = new URLSearchParams()
params.append('Json', query) // 你要传给后台的参数值 key/value
return request({
url: '/erp/saleReturn/update',
method: 'post',
data: params
})
}

View file

@ -60,6 +60,9 @@ export function stockplanlist(query) {
if (query.regionIds !== '' && query.regionIds !== null && query.regionIds !== undefined) { if (query.regionIds !== '' && query.regionIds !== null && query.regionIds !== undefined) {
params.append('regionIds', query.regionIds) // 你要传给后台的参数值 key/value params.append('regionIds', query.regionIds) // 你要传给后台的参数值 key/value
} }
if (query.supplierId !== '' && query.supplierId !== null && query.supplierId !== undefined) {
params.append('supplierId', query.supplierId) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({ return request({

View file

@ -128,6 +128,9 @@ export function search(query) {
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) { if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value
} }
if (query.productCode !== '' && query.productCode !== null && query.productCode !== undefined) {
params.append('productCode', query.productCode) // 你要传给后台的参数值 key/value
}
if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) { if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) {
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
} }

View file

@ -18,6 +18,32 @@ export function regionlist(query) {
}) })
} }
// 查询下一级区域
export function listbyparentid(query) {
var params = new URLSearchParams()
if (query.region !== '' && query.region !== null && query.region !== undefined) {
params.append('parentid', query.region) // 你要传给后台的参数值 key/value
}
return request({
url: '/erp/region/listbyparentid',
method: 'post',
data: params
})
}
// 查询区域名称
export function searchregionName(query) {
var params = new URLSearchParams()
if (query.regionid !== '' && query.regionid !== null && query.regionid !== undefined) {
params.append('regionid', query.regionid) // 你要传给后台的参数值 key/value
}
return request({
url: '/erp/region/list',
method: 'post',
data: params
})
}
// 根据区域查门店 // 根据区域查门店
export function searchRepository(query) { export function searchRepository(query) {
var params = new URLSearchParams() var params = new URLSearchParams()

View 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="1555480747809" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="740" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M427.670588 903.529412H234.917647C189.741176 903.529412 150.588235 864.376471 150.588235 819.2V204.8C150.588235 159.623529 189.741176 120.470588 234.917647 120.470588h551.152941C834.258824 120.470588 873.411765 159.623529 873.411765 204.8v249.976471c0 18.070588-12.047059 30.117647-30.117647 30.117647s-30.117647-12.047059-30.117647-30.117647V204.8c0-12.047059-12.047059-24.094118-24.094118-24.094118H234.917647c-12.047059 0-24.094118 12.047059-24.094118 24.094118v611.388235c0 15.058824 12.047059 27.105882 24.094118 27.105883h192.752941c18.070588 0 30.117647 12.047059 30.117647 30.117647s-12.047059 30.117647-30.117647 30.117647z" p-id="741"></path><path d="M632.470588 499.952941h-90.352941v51.2c-24.094118 21.082353-45.176471 39.152941-60.235294 69.270588h-90.352941c-18.070588 0-30.117647-12.047059-30.117647-30.117647s12.047059-30.117647 30.117647-30.117647h90.352941v-60.235294h-90.352941c-18.070588 0-30.117647-15.058824-30.117647-30.117647s12.047059-30.117647 30.117647-30.117647h63.247059l-57.22353-57.223529c-12.047059-12.047059-12.047059-30.117647 0-42.164706 12.047059-12.047059 30.117647-12.047059 42.164706 0l63.247059 63.247059 6.023529 6.023529c3.011765-3.011765 6.023529-3.011765 6.02353-6.023529l63.247059-63.247059c12.047059-12.047059 30.117647-12.047059 42.164705 0 12.047059 12.047059 12.047059 30.117647 0 42.164706l-57.223529 57.223529H632.470588c15.058824 0 30.117647 12.047059 30.117647 30.117647 0 15.058824-15.058824 30.117647-30.117647 30.117647zM722.823529 963.764706c-117.458824 0-210.823529-93.364706-210.823529-210.82353s93.364706-210.823529 210.823529-210.823529 210.823529 93.364706 210.82353 210.823529-93.364706 210.823529-210.82353 210.82353z m0-361.411765c-84.329412 0-150.588235 66.258824-150.588235 150.588235s66.258824 150.588235 150.588235 150.588236 150.588235-66.258824 150.588236-150.588236-66.258824-150.588235-150.588236-150.588235z" p-id="742"></path><path d="M768 834.258824c-9.035294 0-15.058824-3.011765-21.082353-9.035295L704.752941 783.058824l9.035294-12.047059-9.035294 12.047059c-3.011765-3.011765-6.023529-6.023529-9.035294-12.047059 0-3.011765-3.011765-9.035294-3.011765-12.047059V692.705882c0-18.070588 12.047059-30.117647 30.117647-30.117647s30.117647 12.047059 30.117647 30.117647v54.211765l36.141177 36.141177c12.047059 12.047059 12.047059 30.117647 0 42.164705-6.023529 6.023529-12.047059 9.035294-21.082353 9.035295zM722.823529 758.964706z m0-6.02353l-15.058823 3.011765h15.058823V752.941176z" p-id="743"></path></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View 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="1555579844639" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="828" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M794.305764 503.530827c-16.938346 0-30.796992 13.858647-30.796992 30.796993 0 166.303759-135.250125 301.553885-301.553885 301.553884-166.047118 0-301.553885-135.506767-301.553884-301.553884S295.907769 232.773935 461.954887 232.773935c40.292732 0 79.045614 7.699248 116.002005 23.097744 15.655138 6.672682 33.62005-0.769925 40.292732-16.681704 6.41604-15.655138-0.769925-33.62005-16.681704-40.292732-44.398997-18.478195-91.364411-27.717293-139.613033-27.717293-200.180451 0-363.14787 162.967419-363.147869 363.14787s162.967419 363.14787 363.147869 363.147869S825.102757 734.508271 825.102757 534.32782c0-17.194987-13.602005-30.796992-30.796993-30.796993z" p-id="829"></path><path d="M461.954887 378.546366c20.78797 0 40.806015 4.106266 59.797494 11.805514 15.655138 6.672682 33.62005-0.769925 40.292732-16.681705 6.41604-15.655138-0.769925-33.62005-16.681704-40.292731-26.434085-11.035589-54.664662-16.681704-83.665163-16.681705-119.851629 0-217.375439 97.52381-217.375439 217.375439s97.52381 217.375439 217.375439 217.375439 217.375439-97.52381 217.375438-217.375439c0-16.938346-13.858647-30.796992-30.796992-30.796993s-30.796992 13.858647-30.796993 30.796993c0 85.974937-69.806516 155.781454-155.781453 155.781454s-155.781454-69.806516-155.781454-155.781454c0.256642-85.718296 70.319799-155.524812 156.038095-155.524812z" p-id="830"></path><path d="M982.680702 315.669173c-1.283208-11.035589-8.725815-20.78797-18.991479-24.894236l-54.151378-21.814536 5.902757-4.106266c13.858647-9.752381 17.451629-29.000501 7.699248-42.859148-9.752381-13.858647-29.000501-17.451629-42.859148-7.699248l-20.78797 14.37193-12.062156-63.133834c-2.053133-10.265664-8.982456-18.734837-18.478195-22.841103-9.495739-3.849624-20.531328-2.823058-29.257143 3.079699l-179.649123 123.18797c-6.672682 4.619549-11.292231 11.548872-12.83208 19.761404l-25.407519 132.94035-131.400501 91.10777c-13.858647 9.752381-17.451629 29.000501-7.699248 42.859148 5.902757 8.725815 15.655138 13.345363 25.407519 13.345363 6.159398 0 12.318797-1.796491 17.451629-5.389474l132.170426-91.877694 135.250125 17.451629c1.283208 0.256642 2.566416 0.256642 3.849624 0.256642 6.41604 0 12.575439-2.053133 17.964913-5.646115l195.047619-139.356391c9.239098-6.672682 14.115288-17.708271 12.83208-28.74386z m-316.952381-3.336341l130.373935-89.311278 8.212531 43.885714-149.878697 104.196491 11.292231-58.770927z m83.408521 113.948872l-55.691228-7.185965 156.038095-108.302757 39.266166 15.91178-139.613033 99.576942z" p-id="831"></path></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -201,6 +201,15 @@ export default {
SaleReturn: '销售退货单', SaleReturn: '销售退货单',
AddSaleReturn: '新建销售退货单', AddSaleReturn: '新建销售退货单',
SaleReturnList: '销售退货单列表', SaleReturnList: '销售退货单列表',
SalePlan: '销售计划',
AddSalePlan: '新增销售计划',
SalePlanList: '销售计划列表',
SaleOpportunity: '销售机会',
AddSaleOpportunity: '新增销售机会',
SaleOpportunityList: '销售机会列表',
SaleContract: '销售合同',
AddSaleContract: '新建销售合同',
SaleContractList: '销售合同列表',
CheckCategory: '分类属性', CheckCategory: '分类属性',
CheckCategoryList: '分类属性列表' CheckCategoryList: '分类属性列表'
}, },
@ -1000,6 +1009,7 @@ export default {
allIncludeTaxMoney: '含税金额合计' allIncludeTaxMoney: '含税金额合计'
}, },
StockOrder: { StockOrder: {
supplierNumber: '供应方订单号',
title: '采购订货单主题', title: '采购订货单主题',
orderNumber: '采购单号', orderNumber: '采购单号',
sourceType: '源单类型', sourceType: '源单类型',
@ -1054,7 +1064,8 @@ export default {
acceptAddress: '收货地址', acceptAddress: '收货地址',
retreatDate: '退货日期', retreatDate: '退货日期',
isVat: '是否为增值税', isVat: '是否为增值税',
allRetreatMoney: '应退款合计' allRetreatMoney: '应退款合计',
retreatRepositoryId: '退货仓库'
}, },
StockQuery: { StockQuery: {
productName: '物品名称', productName: '物品名称',
@ -1281,7 +1292,33 @@ export default {
alreadyMoney: '已结金额', alreadyMoney: '已结金额',
enterStatusId: '入库情况', enterStatusId: '入库情况',
ridMoney: '抵应收货款', ridMoney: '抵应收货款',
actualReturnMoney: '实际退款金额' actualReturnMoney: '实际退款金额',
allMoney: '总金额'
},
SalePlan: {
title: '计划主题',
planType: '计划类型',
planDate: '计划日期',
beginTime: '开始时间',
endTime: '结束时间',
lowerPlanMoney: '最低计划额',
planTotalMoney: '计划总金额',
urgePlan: '激励方案',
targetMoney: '计划额',
regionId: '区域',
repositoryid: '门店'
},
SaleOpportunity: {
title: '机会主题',
opportunityType: '机会类型',
customerType: '客户类型',
customerName: '客户姓名',
customerPhone: '客户电话',
opportunitySource: '机会来源',
handlePersonId: '业务员',
deptId: '所属部门',
handleRepositoryId: '所属门店',
isSale: '当前状态'
}, },
public: { public: {
modifyDate: '最后修改日期', modifyDate: '最后修改日期',

View file

@ -1456,6 +1456,52 @@ export const asyncRouterMap = [
component: () => import('@/views/SaleReturn/AddSaleReturn'), component: () => import('@/views/SaleReturn/AddSaleReturn'),
name: 'AddSaleReturn', name: 'AddSaleReturn',
meta: { title: 'AddSaleReturn', noCache: false } meta: { title: 'AddSaleReturn', noCache: false }
},
{
path: 'SaleReturnList',
component: () => import('@/views/SaleReturn/SaleReturnList'),
name: 'SaleReturnList',
meta: { title: 'SaleReturnList', noCache: true }
}
]
},
{
path: '/SalePlan',
component: Layout,
redirect: 'noredirect',
name: 'SalePlan',
alwaysShow: true,
meta: {
title: 'SalePlan',
icon: 'xiaoshoujihua',
type: 3
},
children: [
{
path: 'AddSalePlan',
component: () => import('@/views/SalePlan/AddSalePlan'),
name: 'AddSalePlan',
meta: { title: 'AddSalePlan', noCache: false }
}
]
},
{
path: '/SaleOpportunity',
component: Layout,
redirect: 'noredirect',
name: 'SaleOpportunity',
alwaysShow: true,
meta: {
title: 'SaleOpportunity',
icon: 'xiaoshoujihui',
type: 3
},
children: [
{
path: 'AddSaleOpportunity',
component: () => import('@/views/SaleOpportunity/AddSaleOpportunity'),
name: 'AddSaleOpportunity',
meta: { title: 'AddSaleOpportunity', noCache: false }
} }
] ]
}, },

View file

@ -70,17 +70,18 @@
@select="selectEvent" @select="selectEvent"
@current-change="currentChangeEvent"> @current-change="currentChangeEvent">
<el-editable-column type="selection" width="55" align="center"/> <el-editable-column type="selection" width="55" align="center"/>
<el-editable-column label="流程步骤" prop="step" align="center" width="150px"> <!--<el-editable-column label="流程步骤" prop="step" type="index" align="center" width="150px"/>-->
<template slot-scope="scope"> <!--<template slot-scope="scope">-->
<span>{{ handleStep(scope.row, scope.$index) }}</span> <!--<span>{{ handleStep(scope.row, scope.$index) }}</span>-->
</template> <!--</template>-->
</el-editable-column> <!--</el-editable-column>-->
<el-editable-column label="流程步骤" type="index" align="center" width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="description" align="center" label="步骤描述" width="500px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="description" align="center" label="步骤描述" width="500px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="money" align="center" label="流转条件" width="400px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="money" align="center" label="流转条件" width="400px"/>
<!--<el-editable-column :edit-render="{name: 'ElInput'}" prop="handlerName" align="center" label="步骤处理人" width="200px"/>--> <!--<el-editable-column :edit-render="{name: 'ElInput'}" prop="handlerName" align="center" label="步骤处理人" width="200px"/>-->
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px"> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input v-model="scope.row.handlerName" @focus="handlechoose"/> <el-input v-model="scope.row.handlerName" @focus="handlechoose(scope)" @input="$refs.editable.updateStatus(scope)" @change="$refs.editable.updateStatus(scope)"/>
<my-emp :control.sync="empcontrol" @chuli="chuli(scope, $event)"/> <my-emp :control.sync="empcontrol" @chuli="chuli(scope, $event)"/>
</template> </template>
</el-editable-column> </el-editable-column>
@ -111,6 +112,8 @@ export default {
components: { MyEmp }, components: { MyEmp },
data() { data() {
return { return {
// scope
kongscope: '',
// //
step: 1, step: 1,
// id // id
@ -123,9 +126,6 @@ export default {
categorys: [], categorys: [],
// //
validRules: { validRules: {
step: [
{ required: true, message: '请输入流程步骤', trigger: 'blur' }
],
handlerName: [ handlerName: [
{ required: true, message: '请选择步骤处理人', trigger: 'blue' } { required: true, message: '请选择步骤处理人', trigger: 'blue' }
] ]
@ -266,13 +266,10 @@ export default {
}, },
// //
// focus // focus
handlechoose() { handlechoose(scope) {
this.empcontrol = true this.empcontrol = true
}, console.log(scope)
handleStep(row, index) { this.kongscope = scope
console.log(index)
row.step = index + 1
return row.step
}, },
// change // change
fuzhi(scope) { fuzhi(scope) {
@ -281,8 +278,18 @@ export default {
chuli(scope, val) { chuli(scope, val) {
console.log(val) console.log(val)
console.log(scope) console.log(scope)
scope.row.handlerName = val.personName this.kongscope.row.handlerName = val.personName
scope.row.stepHandler = val.id this.kongscope.row.stepHandler = val.id
// scope.row.handlerName = val.personName
// scope.row.stepHandler = val.id
console.log(scope.row.step)
if (scope.row.step === null) {
scope.row.step = scope.$index + 1
}
return
},
handleStep(row) {
console.log(row)
}, },
postJSON(data) { postJSON(data) {
// //
@ -298,8 +305,8 @@ export default {
console.log(row) console.log(row)
}, },
// //
insertEvent() { insertEvent(index) {
this.$refs.editable.insertAt(-1) this.$refs.editable.insertAt({ step: null }, index)
}, },
// //
currentChangeEvent(currentRow, oldCurrentRow) { currentChangeEvent(currentRow, oldCurrentRow) {

View file

@ -52,13 +52,13 @@
@select="selectEvent" @select="selectEvent"
@current-change="currentChangeEvent"> @current-change="currentChangeEvent">
<el-editable-column type="selection" width="55" align="center"/> <el-editable-column type="selection" width="55" align="center"/>
<el-editable-column type="index" label="流程步骤" prop="step" align="center" width="210px"/> <el-editable-column label="流程步骤" prop="step" type="index" align="center" width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="description" align="center" label="步骤描述" width="200px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="description" align="center" label="步骤描述" width="200px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="money" align="center" label="流转条件" width="200px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="money" align="center" label="流转条件" width="200px"/>
<!--<el-editable-column :edit-render="{name: 'ElInput'}" prop="handlerName" align="center" label="步骤处理人" width="200px"/>--> <!--<el-editable-column :edit-render="{name: 'ElInput'}" prop="handlerName" align="center" label="步骤处理人" width="200px"/>-->
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px"> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input v-model="scope.row.handlerName" @focus="handlechoose"/> <el-input v-model="scope.row.handlerName" @focus="handlechoose(scope)" @input="$refs.editable.updateStatus(scope)"/>
<my-emp :control.sync="empcontrol" @chuli="chuli(scope, $event)"/> <my-emp :control.sync="empcontrol" @chuli="chuli(scope, $event)"/>
</template> </template>
</el-editable-column> </el-editable-column>
@ -96,6 +96,8 @@ export default {
}, },
data() { data() {
return { return {
// scope
kongscope: '',
// //
region: [], region: [],
// //
@ -212,8 +214,9 @@ export default {
}, },
// //
// focus // focus
handlechoose() { handlechoose(scope) {
this.empcontrol = true this.empcontrol = true
this.kongscope = scope
}, },
// change // change
fuzhi(scope) { fuzhi(scope) {
@ -225,20 +228,26 @@ export default {
this.stepHandler = val.id this.stepHandler = val.id
}, },
chuli(scope, val) { chuli(scope, val) {
console.log(val) this.kongscope.row.handlerName = val.personName
console.log(scope) this.kongscope.row.stepHandler = val.id
scope.row.handlerName = val.personName // scope.row.handlerName = val.personName
scope.row.stepHandler = val.id // scope.row.stepHandler = val.id
console.log(scope.row.step)
if (scope.row.step === null) {
scope.row.step = scope.$index + 1
}
}, },
// edit table // edit table
selectEvent(selection, row) { selectEvent(selection, row) {
console.log(selection) console.log(selection)
console.log(row) console.log(row)
}, },
handleStep(row) {
console.log(row)
},
// //
insertEvent(index) { insertEvent(index) {
const row = this.$refs.editable.insertAt(null, index) this.$refs.editable.insertAt({ step: 1 }, index)
this.$nextTick(() => this.$refs.editable.setActiveCell(row, 'handlerName'))
}, },
// //
currentChangeEvent(currentRow, oldCurrentRow) { currentChangeEvent(currentRow, oldCurrentRow) {

View file

@ -284,6 +284,7 @@ export default {
handleConfirm() { handleConfirm() {
this.employeeVisible = false this.employeeVisible = false
this.$emit('chuli', this.choosedata) this.$emit('chuli', this.choosedata)
this.$emit('personName', this.choosedata)
} }
// //
} }

View file

@ -261,7 +261,9 @@ export default {
if (this.personalForm.valuation !== null && this.personalForm.valuation !== undefined) { if (this.personalForm.valuation !== null && this.personalForm.valuation !== undefined) {
this.personalForm.valuation = String(row.valuation) this.personalForm.valuation = String(row.valuation)
} }
this.personalForm.source = String(row.source) if (this.personalForm.source !== null) {
this.personalForm.source = String(row.source)
}
}, },
// //
refreshlist(val) { refreshlist(val) {

View file

@ -7,8 +7,8 @@
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('Product.productname')" prop="productname" style="width: 100%;"> <el-form-item :label="$t('Product.productname')" style="width: 100%;">
<el-input v-model="personalForm.productName" style="margin-left: 18px;width: 200px" placeholder="请输入产品名称" clearable/> <el-input v-model="personalForm.productName" style="margin-left: 18px;width: 200px" placeholder="请输入产品名称" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -162,12 +162,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('Product.effectiveDay')" prop="effectiveDay" style="width: 100%;"> <el-form-item :label="$t('Product.stockCircle')" style="width: 100%;">
<el-input v-model="personalForm.effectiveDay" placeholder="请输入有效天数" clearable style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Product.stockCircle')" prop="stockCircle" style="width: 100%;">
<el-input v-model="personalForm.stockCircle" placeholder="请输采购周期(天)" clearable style="margin-left: 18px;width: 200px"/> <el-input v-model="personalForm.stockCircle" placeholder="请输采购周期(天)" clearable style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -187,6 +182,11 @@
<my-center :control.sync="centercontrol" @center="center"/> <my-center :control.sync="centercontrol" @center="center"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('Product.effectiveDay')" prop="effectiveDay" style="width: 100%;">
<el-input v-model="personalForm.effectiveDay" placeholder="请输入有效天数" clearable style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('Product.isBatch')" prop="isBatch" style="width: 100%;"> <el-form-item :label="$t('Product.isBatch')" prop="isBatch" style="width: 100%;">
<el-radio-group v-model="personalForm.isBatch" style="margin-left: 18px;width: 200px"> <el-radio-group v-model="personalForm.isBatch" style="margin-left: 18px;width: 200px">

View file

@ -207,13 +207,23 @@ export default {
this.editVisible = true this.editVisible = true
this.edittreeform = Object.assign({}, data) this.edittreeform = Object.assign({}, data)
}, },
//
recursion(val) {
if (val.level === 1) {
return val.data
} else {
return this.recursion(val.parent)
}
},
// //
handleNodeClick(data, node) { handleNodeClick(data, node) {
this.personalForm.parentId = data.id this.personalForm.parentId = data.id
this.Iscode = data.code this.Iscode = data.code
this.parentId = data.categoryName this.parentId = data.categoryName
this.personalForm.levle = data.level + 1 this.personalForm.levle = data.level + 1
if (data.code === '01') { const ceshidigui = this.recursion(node)
console.log(ceshidigui)
if (ceshidigui.code === '01') {
this.tishi = true this.tishi = true
this.weishu = '1位' this.weishu = '1位'
} else { } else {

View file

@ -0,0 +1,398 @@
<template>
<div class="ERP-container">
<div class="app-container" style="padding-right: 0">
<!--基本信息-->
<el-card class="box-card" shadow="never">
<h2 ref="geren" class="form-name">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.title')" prop="title" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.opportunityType')" prop="opportunityType" style="width: 100%;">
<el-select v-model="personalForm.opportunityType" style="margin-left: 18px;width: 218px" @change="chooseSource">
<el-option value="1" label="销售出库单"/>
<el-option value="2" label="无来源"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 218px" @change="clearCustomer">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 218px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.customerPhone')" style="width: 100%;">
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.opportunitySource')" style="width: 100%;">
<el-select v-model="personalForm.opportunitySource" style="margin-left: 18px;width: 218px">
<el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.handlePersonId')" prop="handlePersonId" style="width: 100%;">
<el-input v-model="handlePersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.deptId')" style="width: 100%;">
<el-input v-model="deptId" style="margin-left: 18px;width: 218px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.handleRepositoryId')" style="width: 100%;">
<el-input v-model="handleRepositoryId" style="margin-left: 18px;width: 218px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOpportunity.isSale')" prop="isSale" style="width: 100%;">
<el-select v-model="personalForm.isSale" style="margin-left: 18px;width: 218px">
<el-option value="1" label="跟进中"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >意向商品</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
class="click-table1"
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="category" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="typeId" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
</el-editable>
</div>
</el-card>
<!--操作-->
<div class="buttons" style="margin-top: 20px">
<el-button type="primary" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">保存</el-button>
<el-button type="danger" @click="handlecancel()">取消</el-button>
</div>
</div>
</div>
</template>
<script>
import { addsaleopportunity } from '@/api/SaleOpportunity'
import MyEmp from './components/MyEmp'
import MyDelivery from '../DailyAdjust/components/MyDelivery'
import MyDetail from './components/MyDetail'
import MyApply from './components/MyApply'
import MyRequire from './components/MyRequire'
import MyCustomer from './components/MyCustomer'
import MyAgent from './components/MyAgent'
export default {
name: 'AddSaleOpportunity',
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (this.customerId === '' || this.customerId === undefined || this.customerId === null) {
callback(new Error('请选择客户姓名'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(value)
if (this.handlePersonId === '' || this.handlePersonId === undefined || this.handlePersonId === null) {
callback(new Error('请选择业务员'))
} else {
callback()
}
}
return {
//
deptId: '',
//
handleRepositoryId: '',
//
IsNumber: true,
//
Isproduct: true,
//
saleRepositoryId: '',
//
customerId: '',
//
customercontrol: false,
agentcontrol: false,
//
choosedata: [],
//
handlePersonId: '',
//
stockControl: false,
//
control: false,
//
personalForm: {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2,
customerType: '1',
isSale: '1'
},
//
personalrules: {
customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' }
],
handlePersonId: [
{ required: true, validator: validatePass2, trigger: 'change' }
],
customerId: [
{ required: true, validator: validatePass, trigger: 'change' }
],
isSale: [
{ required: true, message: '请选择当前状态', trigger: 'change' }
],
title: [
{ required: true, message: '请输入机会主题', trigger: 'blur' }
]
},
//
list2: [],
//
list3: [],
//
validRules: {
}
}
},
methods: {
//
chooseSource(val) {
if (val === '1') {
this.Isproduct = false
this.IsNumber = false
} else if (val === '2') {
this.Isproduct = false
this.IsNumber = false
}
},
//
clearCustomer() {
this.personalForm.customerId = ''
this.customerId = ''
},
// focus
chooseCustomer() {
if (this.personalForm.customerType === '1') {
this.agentcontrol = true
} else if (this.personalForm.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.personalForm.customerId = val.id
this.personalForm.customerName = val.customerName
this.customerId = val.customerName
this.personalForm.customerPhone = val.phoneNumber
},
agentdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.agentName
this.personalForm.customerPhone = val.phone
},
//
handleAddproduct() {
this.control = true
},
productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
console.log(val)
this.handlePersonId = val.personName
this.personalForm.handlePersonId = val.id
this.handleRepositoryId = val.repositoryName
this.personalForm.handleRepositoryId = val.repositoryId
this.deptId = val.deptName
this.personalForm.deptId = val.deptId
},
//
restAllForm() {
this.personalForm = {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2,
customerType: '1',
isSale: '1'
}
this.customerId = null
this.salePersonId = null
},
//
handlesave() {
const EnterDetail = this.$refs.editable.getRecords()
if (EnterDetail.length === 0) {
this.$notify.error({
title: '错误',
message: '明细表不能为空',
offset: 100
})
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.categoryId === null || elem.categoryId === '' || elem.categoryId === undefined) {
delete elem.categoryId
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.typeId === null || elem.typeId === '' || elem.typeId === undefined) {
delete elem.typeId
}
if (elem.colorId === null || elem.colorId === '' || elem.colorId === undefined) {
delete elem.colorId
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
return elem
})
const parms2 = JSON.stringify(EnterDetail)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => {
if (valid) {
addsaleopportunity(parms, parms2).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: '成功',
message: '保存成功',
type: 'success',
offset: 100
})
this.restAllForm()
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({
title: '错误',
message: res.data.msg,
offset: 100
})
}
})
} else {
this.$notify.error({
title: '错误',
message: '信息未填完整',
offset: 100
})
return false
}
})
},
//
handlecancel() {
this.$router.go(-1)
const view = { path: '/SaleOpportunity/AddSaleOpportunity', name: 'AddSaleOpportunity', fullPath: '/SaleOpportunity/AddSaleOpportunity', title: 'AddSaleOpportunity' }
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.ERP-container{
margin-right: 0;
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 20px;
}
.container{
margin-top: 40px;
}
.el-button+.el-button{
width: 98px;
}
}
</style>

View file

@ -0,0 +1,416 @@
<template>
<el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.number +' 详情'" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<span>{{ personalForm.title }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<span>{{ personalForm.sourceType | sourceTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<span>{{ personalForm.sourceNumber }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<span>{{ personalForm.customerType | customerTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<span>{{ personalForm.customerName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<span>{{ personalForm.customerPhone }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<span>{{ personalForm.closeTypeName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<span>{{ personalForm.payType | payTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<span>{{ personalForm.salePersonName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<span>{{ personalForm.saleRepositoryName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<span>{{ personalForm.receiveAddress }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<span>{{ personalForm.returnDate }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<span>{{ personalForm.currency | currencyFilter }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">退货明细</h2>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
class="click-table1"
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="locationId" align="center" label="货位" min-width="150px"/>
<el-editable-column prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="150px"/>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column prop="returnQuantity" align="center" label="退货数量" min-width="150px"/>
<el-editable-column prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<span>{{ personalForm.allQuantity }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<span>{{ personalForm.allMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<span>{{ personalForm.allIncludeTaxMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<span>{{ personalForm.allTaxMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<span>{{ personalForm.allDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<span>{{ personalForm.allIncludeTaxDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<span>{{ personalForm.ridMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<span>{{ personalForm.actualReturnMoney }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">相关单据状态</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm3" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<span>{{ personalForm.closeStatusId | closeStatusIdFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<span>{{ personalForm.alreadyMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<span>{{ personalForm.enterStatusId | enterStatusIdFilter }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--审核状态-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name">审核状态</h2>
<el-steps :active="reviewList.length" direction="vertical">
<el-step
v-for="(item, index) in reviewList"
:key="index"
:title="'审核步骤' + item.step"
style="height: 100px">
<template slot="description" >
<span style="font-size: 16px;color: red">{{ item.stat | statfilter }}</span><br>
<span style="font-size: 14px">审核人: {{ item.stepHandlerName }}</span><br>
<span style="font-size: 14px">审核时间: {{ item.createTime }}</span>
</template>
</el-step>
</el-steps>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">备注信息</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('public.receiptStat')" style="width: 100%;">
{{ personalForm.receiptStat | receiptStatFilter }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.createPersonName')" prop="stockType" style="width: 100%;">
{{ personalForm.createPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.createDate')" style="width: 100%;">
{{ personalForm.createDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.judgePersonName')" prop="applyDeptId" style="width: 100%;">
{{ personalForm.judgePersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.judgeDate')" prop="sourceType" style="width: 100%;">
{{ personalForm.judgeDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.endPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.endDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyDate }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
</el-dialog>
</template>
<script>
export default {
filters: {
currencyFilter(status) {
const statusMap = {
1: 'RMB',
2: 'USD'
}
return statusMap[status]
},
payTypeFilter(status) {
const statusMap = {
1: '货到付款',
2: '当场支付'
}
return statusMap[status]
},
closeStatusIdFilter(status) {
const statusMap = {
1: '已结算',
2: '未结算'
}
return statusMap[status]
},
enterStatusIdFilter(status) {
const statusMap = {
1: '已入库',
2: '未入库'
}
return statusMap[status]
},
customerTypeFilter(status) {
const statusMap = {
1: '经销商',
2: '零售商'
}
return statusMap[status]
},
statfilter(status) {
const statusMap = {
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: '销售出库单',
2: '无来源'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
}
},
props: {
detailcontrol: {
type: Boolean,
default: false
},
detaildata: {
type: Object,
default: null
}
},
data() {
return {
//
heji1: '',
heji2: '',
//
reviewList: [],
//
list2: [],
list3: [],
//
editVisible: this.detailcontrol,
//
personalForm: this.detaildata
}
},
watch: {
detailcontrol() {
this.editVisible = this.detailcontrol
},
detaildata() {
this.personalForm = this.detaildata
this.list2 = this.personalForm.saleReturnDetailVos
this.reviewList = this.personalForm.approvalUseVos
}
},
methods: {
handlecancel() {
this.editVisible = false
}
}
}
</script>
<style scoped>
.edit >>> .el-dialog{
-webkit-transform: none;
transform: none;
position: absolute;
right: 0;
left: auto;
height: auto;
}
.edit >>> .el-dialog__header{
background: #fff;
position: fixed;
top: 0;
display: block;
width: 1010px;
z-index: 100;
border-bottom: 1px solid #f1f1f1;
}
.edit >>> .el-dialog__body{
padding-left: 0;
padding-right: 0;
padding-top: 10px;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
}
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -0,0 +1,357 @@
<template>
<el-dialog :visible.sync="employeeVisible" :agentcontrol="agentcontrol" :close-on-press-escape="false" top="10px" title="选择经销商" append-to-body width="1100px" @close="$emit('update:agentcontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.agentname" :placeholder="$t('Customer.agentname')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.phone" :placeholder="$t('Customer.phone')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-date-picker
v-model="getemplist.createtime"
type="date"
class="filter-item"
placeholder="选择日期"
value-format="yyyy-MM-dd"/>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Customer.customertype')" clearable style="width: 40%;float: left;margin-left: 20px;">
<el-option
v-for="(item, index) in customertypes"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.level" :value="getemplist.level" :placeholder="$t('Customer.level')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable>
<el-option
v-for="(item, index) in levels"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-input v-model="getemplist.contactname" :placeholder="$t('Customer.contactname')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable />
<el-input v-model="getemplist.pinyin" :placeholder="$t('Customer.pinyin')" style="width: 40%;float: right;margin-right: 20px;margin-top: 20px" clearable />
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.agentname')" :resizable="false" prop="agentName" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.agentName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customertype')" :resizable="false" prop="agentType" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.agentType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.level')" :resizable="false" prop="agentLevel" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.agentLevel }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.traderid')" :resizable="false" prop="traderName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.traderName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.contactname')" :resizable="false" prop="contactName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.contactName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.phone')" :resizable="false" prop="phone" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.phone }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createName')" :resizable="false" prop="createName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createTime')" :resizable="false" prop="createTime" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { searchCusCategory, agentlist } from '@/api/Customer'
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]
},
filterno(status) {
const statusMap = {
1: '老客户',
2: '新客户'
}
return statusMap[status]
}
},
props: {
agentcontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.agentcontrol,
//
visible2: false,
//
customertypes: [],
customertyp: 1,
//
//
levels: [],
levelstype: 2,
//
//
sources: [],
sourcestype: 3,
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
agentname: '',
phone: '',
type: '',
pinyin: '',
level: '',
pagenum: 1,
pagesize: 10,
contactname: '',
source: '',
createtime: ''
},
//
customerForm: {
agentname: '',
phone: '',
type: '',
pinyin: '',
level: '',
source: '',
discount: '',
countryid: '',
provinceid: '',
cityid: '',
introduce: '',
address: '',
contactname: '',
traderid: '',
transmode: '',
deliverymode: '',
createid: '',
newold: ''
}
}
},
watch: {
agentcontrol() {
this.employeeVisible = this.agentcontrol
}
},
mounted() {
this.getlist()
this.getCategory()
},
methods: {
//
getCategory() {
//
searchCusCategory(this.customertyp).then(res => {
if (res.data.ret === 200) {
this.customertypes = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
//
searchCusCategory(this.levelstype).then(res => {
if (res.data.ret === 200) {
this.levels = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
//
searchCusCategory(this.sourcestype).then(res => {
if (res.data.ret === 200) {
this.sources = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
getlist() {
//
this.listLoading = true
agentlist(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() {
this.getemplist.pagenum = 1
agentlist(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.$router.push('/Customer/NewAgent')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
this.$emit('agentdata', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,368 @@
<template>
<el-dialog :visible.sync="employeeVisible" :applycontrol="applycontrol" :close-on-press-escape="false" top="10px" title="选择采购申请单" append-to-body width="1100px" @close="$emit('update:applycontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.title" :placeholder="$t('StockApply.title')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.applyNumber" placeholder="单据编号" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-input v-model="applyPersonId" :placeholder="$t('StockApply.applyPersonId')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechooseStock"/>
</el-form-item>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.applyDeptId" placeholder="申请部门" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option
v-for="(item, index) in depts"
:key="index"
:value="item.id"
:label="item.deptName"/>
</el-select>
<el-select v-model="getemplist.stockType" style="width: 40%;float: right;margin-right: 20px" clearable @focus="updatecountry">
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" placeholder="审批状态" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option value="0" label="未审核"/>
<el-option value="1" label="审核中"/>
<el-option value="2" label="审核通过"/>
<el-option value="3" label="审核不通过"/>
</el-select>
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" placeholder="单据状态" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option value="1" label="制单"/>
<el-option value="2" label="执行"/>
<el-option value="3" label="结单"/>
</el-select>
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
unlink-panels
start-placeholder="Start"
end-placeholder="End"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.title')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.stockType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stockType | stockTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.sourceType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyPersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyDeptId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyDeptName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { stocapplylist } from '@/api/StockApply'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyEmp from '../../StockApply/components/MyEmp'
export default {
directives: { waves },
components: { MyEmp, Pagination },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: '未审核',
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: '无来源'
}
return statusMap[status]
}
},
props: {
applycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.applycontrol,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
types: [],
//
depts: [],
//
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
},
//
detailvisible: false,
//
visible2: false,
//
applyPersonId: '',
//
stockControl: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: 438,
regionIds: 2,
createPersonId: 3
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
applycontrol() {
this.employeeVisible = this.applycontrol
}
},
created() {
this.getlist()
},
methods: {
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
stocapplylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
searchStockCategory(this.typeparms).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
//
restFilter() {
this.applyPersonId = ''
this.getemplist.applyPersonId = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
stocapplylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.applyPersonId = val.personName
this.getemplist.applyPersonId = val.id
},
//
handleAdd() {
this.$router.push('/StockApply/AddStockApply')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const applydata = this.choosedata.stockApplyDetailVos
const number = this.choosedata.applyNumber
const applyDetail = applydata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productType: item.productType,
typeId: item.typeId,
unit: item.unit,
color: item.color,
basicQuantity: item.applyQuantity,
planDeliveryDate: item.requireDate,
applyReason: item.applyReason,
sourceNumber: number,
supplierId: '',
supplierName: '',
basicPrice: ''
}
})
this.$emit('apply', applyDetail)
this.$emit('apply2', applyDetail)
this.$emit('allinfo', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,365 @@
<template>
<el-dialog :visible.sync="employeeVisible" :customercontrol="customercontrol" :close-on-press-escape="false" top="10px" title="选择客户" append-to-body width="1100px" @close="$emit('update:customercontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.customername" :placeholder="$t('Customer.customername')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.customerphone" :placeholder="$t('Customer.phone')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Customer.customertype')" clearable>
<el-option
v-for="(item, index) in customertypes"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: left;margin-left: 20px;">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.repositoryid" placeholder="请选择门店" filterable clearable 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.level" :placeholder="$t('Customer.level')" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option
v-for="(item, index) in levels"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</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" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customername')" :resizable="false" align="center" width="80">
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customertype')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.customerTypeWZ }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.level')" :resizable="false" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.customerLevel }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.birthday')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.birthday }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.source')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.source }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.newold')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.newOrOld | filterno }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.phone')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.gender')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.gender | genderFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.address')" :resizable="true" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.address }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.point')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.point }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createTime')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { searchRepository } from '@/api/public'
import { searchCusCategory, customerlist } from '@/api/Customer'
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]
},
filterno(status) {
const statusMap = {
1: '老客户',
2: '新客户'
}
return statusMap[status]
}
},
props: {
customercontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.customercontrol,
//
visible2: false,
//
//
customertypes: [],
customertyp: 1,
//
//
levels: [],
levelstype: 2,
//
//
sources: [],
sourcestype: 3,
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
customername: '',
customerphone: '',
level: '',
createtime: '',
type: '',
pagenum: 1,
pagesize: 10,
repositoryid: '',
source: ''
},
//
depts: [],
//
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions: [],
getemplistregions: [],
//
repositories: []
}
},
watch: {
customercontrol() {
this.employeeVisible = this.customercontrol
}
},
mounted() {
this.getlist()
this.getCategory()
},
methods: {
//
getCategory() {
//
searchCusCategory(this.customertyp).then(res => {
if (res.data.ret === 200) {
this.customertypes = res.data.data.content.list
} else {
console.log('客户类型出错')
}
})
//
searchCusCategory(this.levelstype).then(res => {
if (res.data.ret === 200) {
this.levels = res.data.data.content.list
} else {
console.log('客户优质级别出错')
}
})
//
searchCusCategory(this.sourcestype).then(res => {
if (res.data.ret === 200) {
this.sources = res.data.data.content.list
} else {
console.log('客户来源出错')
}
})
//
searchRepository().then(res => {
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
console.log('门店出错')
}
})
},
getlist() {
//
this.listLoading = true
customerlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
} else {
console.log('员工列表出错')
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
},
//
handleFilter() {
this.getemplist.pagenum = 1
customerlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
} else {
console.log('搜索出错')
}
})
},
//
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('出错了')
}
})
},
//
handleAdd() {
this.$router.push('/Customer/NewCustomer')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
this.$emit('customerdata', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,326 @@
<template>
<el-dialog :visible.sync="employeeVisible" :deliverycontrol="deliverycontrol" :close-on-press-escape="false" top="10px" title="选择员工" append-to-body @close="$emit('update:deliverycontrol', 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
v-for="(item, index) in jobs"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</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>
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">确认添加</el-button>
<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, searchEmpCategory } 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: {
deliverycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
jobCat: {
type: 2,
pagenum: 1,
pagesize: 9999
},
//
jobs: [],
//
choosedata: '',
//
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.deliverycontrol,
//
regionManagerVisible: false
}
},
watch: {
deliverycontrol() {
this.employeeVisible = this.deliverycontrol
}
},
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
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
}
})
//
searchEmpCategory(this.jobCat).then(res => {
if (res.data.ret === 200) {
this.jobs = res.data.data.content.list
} else {
console.log('职位列表出错')
}
})
},
//
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
}
})
},
//
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.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('deliveryName', this.choosedata)
}
//
}
}
</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>

View file

@ -0,0 +1,302 @@
<template>
<el-dialog :visible.sync="productVisible" :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.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.productname" :placeholder="$t('Product.productname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="supplierid" :placeholder="$t('Product.supplierid')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
<el-input v-model="categoryid" placeholder="物品分类" class="filter-item" clearable @focus="treechoose"/>
<my-tree :treecontrol.sync="treecontrol" @tree="tree"/>
<!-- 更多搜索条件下拉栏 -->
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.typeid" placeholder="请选择规格型号" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
<el-select v-model="getemplist.isactive" placeholder="请选择上下架" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option value="1" label="上1"/>
<el-option value="2" label="下2"/>
</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" @click="visible2 = !visible2">{{ $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"
: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('Product.code')" :resizable="false" prop="code" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.productname')" :resizable="false" prop="ProductName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.categoryid')" :resizable="false" prop="category" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.category }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.typeid')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.color')" :resizable="false" prop="color" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.kpigrade')" :resizable="false" prop="kpiGrade" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.kpiGrade }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.point')" :resizable="false" prop="point" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.point }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.costprice')" :resizable="false" prop="costPrice" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.costPrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.purchaseprice')" :resizable="false" prop="purchasePrice" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.purchasePrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createid')" :resizable="false" prop="createName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createTime')" :resizable="false" prop="createTime" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" style="padding: 0" @pagination="getlist" />
<span slot="footer" class="dialog-footer">
<el-button v-waves type="success" style="text-align: center;" @click="handleAddTo">确认添加</el-button>
</span>
</el-dialog>
</template>
<script>
import { productlist, searchEmpCategory2 } from '@/api/Product'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MySupplier from '../../Product/components/MySupplier'
import MyTree from '../../Product/components/MyTree' // Secondary package based on el-pagination
export default {
directives: { waves },
components: { MyTree, MySupplier, Pagination },
filters: {
genderFilter(status) {
const statusMap = {
1: '男',
2: '女'
}
return statusMap[status]
}
},
props: {
control: {
type: Boolean,
default: false
}
},
data() {
return {
//
supplierid: '',
//
empcontrol: false,
//
types: [],
//
treecontrol: false,
//
categoryid: '',
//
productVisible: this.control,
//
visible2: false,
//
moreaction: '',
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
productid: '',
code: '',
productname: '',
categoryid: '',
typeid: '',
isactive: '',
Productid: '',
pagenum: 1,
pagesize: 10
}
}
},
watch: {
control() {
this.productVisible = this.control
console.log(this.control)
this.getlist()
}
},
created() {
this.getlist()
},
methods: {
getlist() {
//
this.listLoading = true
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
searchEmpCategory2(2).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
restFilter() {
this.categoryid = ''
this.getemplist.categoryid = ''
this.supplierid = ''
this.getemplist.supplierid = ''
},
//
handleFilter() {
this.getemplist.pagenum = 1
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
//
handleSelectionChange(val) {
this.moreaction = val
},
// focus
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierid = val.supplierName
this.getemplist.supplierid = val.id
},
// focus
treechoose() {
this.treecontrol = true
},
//
tree(val) {
this.categoryid = val.categoryName
this.getemplist.categoryid = val.id
},
//
handleAdd() {
this.$router.push('/Product/NewProduct')
this.productVisible = false
},
//
handleAddTo() {
this.productVisible = false
console.log(this.moreaction)
const productDetail = this.moreaction.map(function(item) {
return {
productCode: item.code,
productName: item.productName,
category: item.category,
categoryId: item.categoryId,
productType: item.typeId,
typeId: item.productType,
color: item.color,
colorId: item.colorId,
unit: item.purMeasu,
kpiGrade: item.kpiGrade,
point: item.point
}
})
console.log(productDetail)
this.$emit('product', productDetail)
}
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 150px;
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>

View file

@ -0,0 +1,755 @@
<template>
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.number +' 修改'" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseSource">
<el-option value="1" label="销售出库单"/>
<el-option value="2" label="无来源"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<el-select v-model="personalForm.closeType" style="margin-left: 18px;width: 200px">
<el-option
v-for="(item, index) in colseTypes"
:value="item.id"
:key="index"
:label="item.categoryName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<el-select v-model="personalForm.payType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<el-input v-model="saleRepositoryId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<el-input v-model="personalForm.receiveAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<el-date-picker
v-model="personalForm.returnDate"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<el-select v-model="personalForm.currency" style="margin-left: 18px;width: 200px">
<el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >退货明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
show-summary
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column :edit-render="{type: 'visible'}" prop="locationId" align="center" label="货位" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" placeholder="请选择货位" filterable clearable style="width: 100%;" @visible-change="updatebatch($event,scope)">
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="150px"/>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="returnQuantity" align="center" label="退货数量" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.returnQuantity"
@change="getquantity(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', attrs: {min: 0}, type: 'visible'}" prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<el-input v-model="heji1" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<el-input v-model="heji2" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<el-input v-model="heji3" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<el-input v-model="heji4" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<el-input v-model="heji5" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<el-input v-model="heji6" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<el-input v-model="personalForm.ridMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<el-input v-model="personalForm.actualReturnMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">相关单据状态</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<el-select v-model="personalForm.closeStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label="已结算"/>
<el-option value="2" label="未结算"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<el-input v-model="personalForm.alreadyMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<el-select v-model="personalForm.enterStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label="已入库"/>
<el-option value="2" label="未入库"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">取消</el-button>
<el-button type="primary" @click="handleEditok()">保存</el-button>
</div>
</el-card>
</el-dialog>
</template>
<script>
import { updatesaleReturn } from '@/api/SaleReturn'
import { searchSaleCategory } from '@/api/SaleCategory'
import { getlocation, locationlist } from '@/api/public'
import MyEmp from './MyEmp'
import MyDelivery from './MyDelivery'
import MyDetail from './MyDetail'
import MyApply from './MyApply'
import MyRequire from './MyRequire'
import MyCustomer from './MyCustomer'
import MyAgent from './MyAgent'
export default {
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
props: {
editcontrol: {
type: Boolean,
default: false
},
editdata: {
type: Object,
default: null
}
},
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (value === '') {
callback(new Error('请选择'))
} else {
callback()
}
}
return {
//
choosedata: [],
//
editVisible: this.editcontrol,
//
personalForm: this.editdata,
//
heji1: '',
heji2: '',
heji3: '',
heji4: '',
heji5: '',
heji6: '',
heji7: '',
heji8: '',
heji9: '',
//
locationlist: [],
//
IsNumber: true,
//
Isproduct: true,
//
saleRepositoryId: '',
//
customerId: '',
//
customercontrol: false,
agentcontrol: false,
//
salePersonId: '',
//
stockControl: false,
//
colseTypes: [],
//
colseTypeparms: {
type: 3,
pagenum: 1,
pagesize: 99999,
iseffective: 1
},
//
control: false,
//
personalrules: {
customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' }
],
customerName: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
returnDate: [
{ required: true, message: '请选择退货日期', trigger: 'change' }
],
currency: [
{ required: true, message: '请选择币种', trigger: 'change' }
],
sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' }
],
closeStatusId: [
{ required: true, message: '请选择结算状态', trigger: 'change' }
]
},
//
list2: [],
//
list3: [],
//
validRules: {
}
}
},
watch: {
editcontrol() {
this.editVisible = this.editcontrol
},
editdata() {
this.personalForm = this.editdata
this.salePersonId = this.personalForm.salePersonName
this.customerId = this.personalForm.customerName
this.saleRepositoryId = this.personalForm.saleRepositoryName
this.personalForm.customerPhone = this.personalForm.phoneNumber
this.list2 = this.personalForm.saleReturnDetailVos
this.chooseSource()
}
},
created() {
this.getTypes()
},
methods: {
updatebatch(event, scope) {
if (event === true) {
if (this.personalForm.saleRepositoryId === undefined || this.personalForm.saleRepositoryId === '') {
this.$notify.error({
title: '错误',
message: '请先选择仓库',
offset: 100
})
return false
}
getlocation(this.personalForm.saleRepositoryId, scope.row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.saleRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
}
},
getTypes() {
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
//
chooseSource(val) {
if (val === '1') {
this.Isproduct = true
this.IsNumber = false
} else if (val === '2') {
this.Isproduct = false
this.IsNumber = true
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return (prev).toFixed(2)
}
}, 0)
sums[index] += ''
} else {
sums[index] = ''
}
})
sums[2] = ''
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = ''
sums[7] = ''
sums[8] = ''
sums[9] = ''
sums[25] = ''
sums[27] = ''
sums[28] = ''
sums[29] = ''
sums[30] = ''
this.heji1 = sums[24]
this.heji2 = sums[19]
this.heji3 = sums[16]
this.heji4 = sums[18]
this.heji5 = sums[22]
this.heji6 = sums[20] - sums[22]
return sums
},
//
getdiscountMoney(row) {
row.discount = ((1 - row.discountMoney / row.salePrice / row.quantity) * 100).toFixed(2)
},
//
getdiscount(row) {
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2)
},
getquantity(row) {
row.costMoney = row.returnQuantity * row.costPrice
row.taxprice = row.salePrice * (1 + row.taxRate / 100)
row.includeTaxMoney = row.returnQuantity * row.taxprice
row.money = row.returnQuantity * row.salePrice
row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney
row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.returnQuantity).toFixed(2)
if (row.returnQuantity !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.returnQuantity)) * 100).toFixed(2)
row.discount = (1 - row.discountMoney / row.salePrice / row.returnQuantity).toFixed(2)
}
row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
return row.returnQuantity
},
//
gettaxprice(row) {
row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(2)
return row.taxprice
},
//
gettaxRate(row) {
if (row.taxRate !== 0) {
row.taxMoney = (row.salePrice * row.taxRate * row.quantity / 100).toFixed(2)
}
return row.taxRate
},
//
gettaxMoney(row) {
if (row.taxMoney !== 0 && row.quantity !== 0 && row.salePrice !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2)
}
return row.taxMoney
},
//
clearCustomer() {
this.personalForm.customerId = ''
this.customerId = ''
},
// focus
chooseCustomer() {
if (this.personalForm.customerType === '1') {
this.agentcontrol = true
} else if (this.personalForm.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.customerName
this.personalForm.customerPhone = val.phoneNumber
},
agentdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.agentName
this.personalForm.customerPhone = val.phone
},
//
handleAddproduct() {
this.control = true
},
productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
deleteChange(val) {
this.choosedata = val
},
//
updatecountry() {
this.getTypes()
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.salePersonId = val.personName
this.personalForm.salePersonId = val.id
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.repositoryId
this.roleId = val.postName
this.personalForm.roleId = val.postId
},
//
restAllForm() {
this.personalForm = {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2
}
this.customerId = null
this.salePersonId = null
},
//
//
handleEditok() {
this.personalForm.repositoryId = 438
this.personalForm.regionId = 2
this.personalForm.createPersonId = 3
this.personalForm.countryId = 1
this.personalForm.modifyPersonId = 3
const EnterDetail = this.$refs.editable.getRecords()
if (EnterDetail.length === 0) {
this.$notify.error({
title: '错误',
message: '明细表不能为空',
offset: 100
})
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discount === null || elem.discount === '' || elem.discount === undefined) {
delete elem.discount
}
if (elem.discount !== null || elem.discount !== '' || elem.discount !== undefined) {
elem.discount = elem.discount / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
delete elem.alreadyReturnQuantity
}
if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
delete elem.returnQuantity
}
if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) {
delete elem.returnReason
}
if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) {
delete elem.sendQuantity
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
delete elem.locationId
}
return elem
})
const parms2 = JSON.stringify(EnterDetail)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
const parms = JSON.stringify(Data)
updatesaleReturn(parms, parms2).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: '操作成功',
message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
handlecancel() {
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
}
// -------------------------------------------------
}
}
</script>
<style scoped>
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -0,0 +1,332 @@
<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
v-for="(item, index) in jobs"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</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>
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">确认添加</el-button>
<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, searchEmpCategory } 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 {
//
jobCat: {
type: 2,
pagenum: 1,
pagesize: 9999
},
//
jobs: [],
//
choosedata: '',
//
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
}
},
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
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
}
})
//
searchEmpCategory(this.jobCat).then(res => {
if (res.data.ret === 200) {
this.jobs = res.data.data.content.list
} else {
console.log('职位列表出错')
}
})
},
//
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.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('stockName', this.choosedata)
}
//
}
}
</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>

View file

@ -0,0 +1,331 @@
<template>
<el-dialog :visible.sync="employeeVisible" :requirecontrol="requirecontrol" :close-on-press-escape="false" top="10px" title="选择采购需求单" append-to-body width="1100px" @close="$emit('update:requirecontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="categoryId" :placeholder="$t('StockRequire.categoryId')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="treechoose"/>
<my-tree :treecontrol.sync="treecontrol" @tree="tree"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.productName" placeholder="物料名称" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handleAddproduct"/>
<my-detail :control.sync="control" @productdata="productdata"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-select v-model="getemplist.isPlan" :value="getemplist.isPlan" class="filter-item" placeholder="是否已生成采购计划" clearable>
<el-option value="1" label="是"/>
<el-option value="2" label="否"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
unlink-panels
start-placeholder="需求日期开始"
end-placeholder="需求日期结束"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<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('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.materialsRequireNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productName')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productCode')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productCode }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.categoryId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productCategory }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.color')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.unit')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.unit }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.requireQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.requireQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.inventoryQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.inventoryQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.shouldStockQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.shouldStockQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.stockAdvanceday')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stockAdvanceday }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.requireDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.requireDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.isPlan')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.isPlaned | isPlanedFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { stockrequirelist } from '@/api/StockRequire'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyTree from '../../Product/components/MyTree'
import MyDetail from '../../StockRequire/components/MyDetail'
export default {
directives: { waves },
components: { MyDetail, MyTree, Pagination },
filters: {
isPlanedFilter(status) {
const statusMap = {
1: '是',
2: '否'
}
return statusMap[status]
}
},
props: {
requirecontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.requirecontrol,
//
choosedata: '',
//
control: false,
//
categoryId: '',
//
treecontrol: false,
//
detailvisible: false,
//
visible2: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: 438,
regionIds: 2,
createPersonId: 3
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
requirecontrol() {
this.employeeVisible = this.requirecontrol
}
},
created() {
this.getlist()
},
methods: {
// focus
handleAddproduct() {
this.control = true
},
//
productdata(val) {
this.getemplist.productName = val.productName
},
// focus
treechoose() {
this.treecontrol = true
},
//
tree(val) {
this.categoryId = val.categoryName
this.getemplist.categoryId = val.id
},
getlist() {
//
this.listLoading = true
stockrequirelist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
},
//
restFilter() {
this.handlePersonId = ''
this.getemplist.handlePersonId = ''
this.workCenterId = ''
this.getemplist.workCenterId = ''
this.producePlanNumber = ''
this.getemplist.producePlanNumber = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
if (this.date === null || this.date === '') {
this.getemplist.beginTime = null
this.getemplist.endTime = null
} else {
this.getemplist.beginTime = this.date[0]
this.getemplist.endTime = this.date[1]
}
stockrequirelist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
//
handleSelectionChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const requiredata = this.choosedata
const requireDetail = requiredata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productType: item.productType,
typeId: item.typeId,
unit: item.unit,
color: item.color,
basicQuantity: item.requireQuantity,
planDeliveryDate: item.requireDate,
applyReason: '',
sourceNumber: item.materialsRequireNumber,
supplierId: '',
supplierName: '',
basicPrice: ''
}
})
this.$emit('require', requireDetail)
this.$emit('require2', requireDetail)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -605,7 +605,6 @@ export default {
// //
handlesave() { handlesave() {
const EnterDetail = this.$refs.editable.getRecords() const EnterDetail = this.$refs.editable.getRecords()
const EnterDetail2 = this.$refs.editable2.getRecords()
if (EnterDetail.length === 0) { if (EnterDetail.length === 0) {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
@ -679,22 +678,7 @@ export default {
} }
return elem return elem
}) })
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.costName === null || elem.costName === '' || elem.costName === undefined) {
delete elem.costName
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.remark === null || elem.remark === '' || elem.remark === undefined) {
delete elem.remark
}
return elem
})
const parms2 = JSON.stringify(EnterDetail) const parms2 = JSON.stringify(EnterDetail)
const parms3 = JSON.stringify(EnterDetail2)
const Data = this.personalForm const Data = this.personalForm
for (const key in Data) { for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) { if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
@ -704,7 +688,7 @@ export default {
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
createsaleOrder(parms, parms2, parms3, this.personalForm).then(res => { createsaleOrder(parms, parms2, this.personalForm).then(res => {
console.log(res) console.log(res)
if (res.data.ret === 200) { if (res.data.ret === 200) {
this.$notify({ this.$notify({

View file

@ -336,7 +336,11 @@ export default {
sourceNumber: number, sourceNumber: number,
supplierId: '', supplierId: '',
supplierName: '', supplierName: '',
basicPrice: '' basicPrice: '0.00',
requireQuantity: item.requireQuantity,
planQuantity: item.requireQuantity,
requireDate: item.requireDate,
planMoney: '0.00'
} }
}) })
this.$emit('apply', applyDetail) this.$emit('apply', applyDetail)

View file

@ -0,0 +1,832 @@
<template>
<div class="ERP-container">
<div class="app-container" style="padding-right: 0">
<!--基本信息-->
<el-card class="box-card" shadow="never">
<h2 ref="geren" class="form-name">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.title')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.planType')" prop="planType" style="width: 100%;">
<el-select v-model="personalForm.planType" style="margin-left: 18px;width: 218px">
<el-option value="1" label="年"/>
<el-option value="2" label="月"/>
<el-option value="3" label="周"/>
<el-option value="4" label="日"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.planDate')" style="width: 100%;">
<el-date-picker
v-model="personalForm.planDate"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.beginTime')" style="width: 100%;">
<el-date-picker
v-model="personalForm.beginTime"
:picker-options="pickerOptions0"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px"
@change="cleardeposit"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.endTime')" style="width: 100%;">
<el-date-picker
v-model="personalForm.endTime"
:picker-options="pickerOptions1"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" style="width: 100%;">
<el-input v-model="personalForm.lowerPlanMoney" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.planTotalMoney')" style="width: 100%;">
<el-input v-model="personalForm.planTotalMoney" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SalePlan.urgePlan')" style="width: 100%;">
<el-input v-model="personalForm.urgePlan" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >计划明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="handleAddproduct">添加明细</el-button>
<el-button type="danger">删除</el-button>
</div>
<el-dialog :visible.sync="categoryVisible" title="添加明细" class="normal" width="600px" center>
<el-form ref="addCategoryForm" :model="addCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
<el-form-item :label="$t('SalePlan.regionId')" label-width="100px" prop="type">
<el-cascader v-model="addCategoryForm.regionId" :options="provinceList" :props="props" placeholder="" style="width: 100%" @active-item-change="handleItemChange" @change="handlechange4"/>
</el-form-item>
<el-form-item :label="$t('SalePlan.repositoryid')" label-width="100px">
<el-select v-model="addCategoryForm.repositoryid" placeholder="请选择门店" filterable style="width: 100%;" @change="changeValue">
<el-option
v-for="(item, index) in repositories"
:key="index"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" label-width="100px">
<el-input v-model="addCategoryForm.lowerMoney" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('SalePlan.targetMoney')" label-width="100px">
<el-input v-model="addCategoryForm.targetMoney" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlesave2()">保存</el-button>
<el-button type="danger" @click="handlecancel()">取消</el-button>
</span>
</el-dialog>
<div class="container">
<el-tree
:data="data2"
:props="defaultProps"
:check-strictly = "true"
show-checkbox
node-key="id"
@check-change="handleCheckChange"/>
</div>
</el-card>
<!--操作-->
<div class="buttons" style="margin-top: 20px">
<el-button type="primary" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">保存</el-button>
<el-button type="danger" @click="handlecancel()">取消</el-button>
</div>
</div>
</div>
</template>
<script>
// import { createSalePlan } from '@/api/SalePlan'
import { searchSaleCategory } from '@/api/SaleCategory'
import { listbyparentid, searchRepository, searchregionName } from '@/api/public'
import MyEmp from './components/MyEmp'
import MyDelivery from '../DailyAdjust/components/MyDelivery'
import MyDetail from './components/MyDetail'
import MyApply from './components/MyApply'
import MyRequire from './components/MyRequire'
import MyCustomer from './components/MyCustomer'
import MyAgent from './components/MyAgent'
export default {
name: 'AddSalePlan',
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (value === '') {
callback(new Error('请选择'))
} else {
callback()
}
}
return {
pickerOptions0: {
disabledDate: (time) => {
if (this.personalForm.endTime !== null) {
return time.getTime() > new Date(this.personalForm.endTime).getTime() - 8.64e7
}
}
},
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date(this.personalForm.beginTime).getTime() - 8.64e7
}
},
//
repositories: [],
//
provinceList: [],
//
props: { value: 'value', children: 'cities' },
//
categoryVisible: false,
//
addCategoryForm: { label: '', id: 1, parentId: 0, level: 1, children: [], lowerMoney: '', targetMoney: '' },
//
lowerMoney: '',
//
targetMoney: '',
//
data2: [],
defaultProps: {
children: 'children',
label: 'label'
},
//
heji1: '',
heji2: '',
heji3: '',
heji4: '',
heji5: '',
heji6: '',
heji7: '',
heji8: '',
heji9: '',
//
IsNumber: true,
//
Isproduct: true,
//
saleRepositoryId: '',
//
customerId: '',
//
customercontrol: false,
agentcontrol: false,
//
choosedata: [],
//
salePersonId: '',
//
stockControl: false,
//
colseTypes: [],
//
colseTypeparms: {
type: 3,
pagenum: 1,
pagesize: 99999,
iseffective: 1
},
//
control: false,
//
personalForm: {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2,
beginTime: null,
endTime: null
},
//
personalrules: {
customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' }
],
customerName: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
returnDate: [
{ required: true, message: '请选择退货日期', trigger: 'change' }
],
currency: [
{ required: true, message: '请选择币种', trigger: 'change' }
],
sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' }
],
closeStatusId: [
{ required: true, message: '请选择结算状态', trigger: 'change' }
]
},
//
list2: [],
//
list3: [],
//
validRules: {
}
}
},
created() {
this.getTypes()
},
methods: {
// handleCheckChange(data, checked) {
// console.log(data)
// if (checked === true) {
//
// }
// },
//
cleardata() {
this.addCategoryForm = { label: '', id: 1, parentId: 0, level: 1, children: [] }
},
//
handlesave2() {
const treeData = { label: '', id: 1, parentId: 0, level: 1, children: [] }
treeData.label = this.addCategoryForm.repositoryName + ': 最低目标额(元): ' + this.addCategoryForm.lowerMoney + ' ' + '目标额(元); ' + this.addCategoryForm.targetMoney
this.data2.push(treeData)
this.categoryVisible = false
this.cleardata()
this.addCategoryForm.id++
console.log(this.data2)
},
changeValue(value) {
console.log(value)
console.log(this.repositories)
let obj = {}
obj = this.repositories.find((item) => {
return item.id === value
})
this.addCategoryForm.repositoryName = obj.repositoryName
},
//
handlechange4(val) {
const finalid = val[val.length - 1]
searchregionName(finalid).then(res => {
console.log(res)
})
searchRepository(finalid).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
console.log('区域选择门店')
}
})
},
getPosition(val, cb) {
console.log(val)
const vm = this //
let params = {}
if (!val) { //
params = { region: this.personalForm.regionId }
} else if (val.length === 1) { //
params = { region: val[0] }
} else if (val.length === 2) { // 3
params = { region: val[1] }
} else if (val.length === 3) { // 4
params = { region: val[2] }
} else if (val.length === 4) { // 5
params = { region: val[3] }
} else if (val.length === 5) { // 6
params = { region: val[4] }
} else if (val.length === 6) { // 7
params = { region: val[5] }
}
listbyparentid(params).then((res) => {
if (!val) { //
vm.provinceList = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
} else if (val.length === 1) { //
vm.provinceList.map((item) => {
if (item.value === val[0]) {
if (res.data.data.content === undefined) {
item.cities = null
return
}
item.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
}
})
} else if (val.length === 2) { // 3
vm.provinceList.map((item) => {
if (item.value === val[0]) {
item.cities.map((value) => {
if (value.value === val[1]) {
if (res.data.data.content === undefined) {
value.cities = null
return
}
value.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
}
})
}
})
} else if (val.length === 3) { // 4
console.log(vm.provinceList)
vm.provinceList.map((item) => {
if (item.value === val[0]) {
item.cities.map((value) => {
if (value.value === val[1]) {
value.cities.map((value2) => {
if (res.data.data.content === undefined) {
value2.cities = null
return
}
value2.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
})
}
})
}
})
} else if (val.length === 4) { // 5
console.log(vm.provinceList)
vm.provinceList.map((item) => {
if (item.value === val[0]) {
item.cities.map((value) => {
if (value.value === val[1]) {
value.cities.map((value2) => {
if (value2.value === val[2]) {
value2.cities.map((value3) => {
if (res.data.data.content === undefined) {
value3.cities = null
return
}
value3.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
})
}
})
}
})
}
})
} else if (val.length === 5) { // 6
console.log(vm.provinceList)
vm.provinceList.map((item) => {
if (item.value === val[0]) {
item.cities.map((value) => {
if (value.value === val[1]) {
value.cities.map((value2) => {
if (value2.value === val[2]) {
value2.cities.map((value3) => {
if (value3.value === val[3]) {
value3.cities.map((value4) => {
if (res.data.data.content === undefined) {
value4.cities = null
return
}
value4.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
})
}
})
}
})
}
})
}
})
} else if (val.length === 6) { // 7
console.log(vm.provinceList)
vm.provinceList.map((item) => {
if (item.value === val[0]) {
item.cities.map((value) => {
if (value.value === val[1]) {
value.cities.map((value2) => {
if (value2.value === val[2]) {
value2.cities.map((value3) => {
if (value3.value === val[3]) {
value3.cities.map((value4) => {
if (value4.value === val[4]) {
value4.cities.map((value5) => {
if (res.data.data.content === undefined) {
value5.cities = null
return
}
value5.cities = res.data.data.content.map((e) => {
return { value: e.id, label: e.regionName, cities: [] }
})
})
}
})
}
})
}
})
}
})
}
})
}
cb && cb(res)
}).catch(err => {
console.log(err)
})
},
handleItemChange(val) {
this.getPosition(val)
},
//
cleardeposit() {
this.personalForm.endTime = null
},
getTypes() {
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
searchRepository(this.personalForm.regionId).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
console.log('区域选择门店')
}
})
},
//
chooseSource(val) {
if (val === '1') {
this.Isproduct = true
this.IsNumber = false
} else if (val === '2') {
this.Isproduct = false
this.IsNumber = true
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return (prev).toFixed(2)
}
}, 0)
sums[index] += ''
} else {
sums[index] = ''
}
})
sums[2] = ''
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = ''
sums[7] = ''
sums[8] = ''
sums[9] = ''
sums[25] = ''
sums[27] = ''
sums[28] = ''
sums[29] = ''
sums[30] = ''
this.heji1 = sums[24]
this.heji2 = sums[19]
this.heji3 = sums[16]
this.heji4 = sums[18]
this.heji5 = sums[22]
this.heji6 = sums[20] - sums[22]
return sums
},
//
getdiscountMoney(row) {
row.discount = ((1 - row.discountMoney / row.salePrice / row.quantity) * 100).toFixed(2)
},
//
getdiscount(row) {
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2)
},
//
getquantity(row) {
row.costMoney = row.returnQuantity * row.costPrice
row.includeTaxMoney = row.returnQuantity * row.taxprice
row.money = row.returnQuantity * row.salePrice
row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney
row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.returnQuantity).toFixed(2)
if (row.returnQuantity !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.returnQuantity)) * 100).toFixed(2)
row.discount = (1 - row.discountMoney / row.salePrice / row.returnQuantity).toFixed(2)
}
row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
return row.returnQuantity
},
//
gettaxprice(row) {
row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(2)
return row.taxprice
},
//
gettaxRate(row) {
if (row.taxRate !== 0) {
row.taxMoney = (row.salePrice * row.taxRate * row.quantity / 100).toFixed(2)
}
return row.taxRate
},
//
gettaxMoney(row) {
if (row.taxMoney !== 0 && row.quantity !== 0 && row.salePrice !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2)
}
return row.taxMoney
},
//
clearCustomer() {
this.personalForm.customerId = ''
this.customerId = ''
},
// focus
chooseCustomer() {
if (this.personalForm.customerType === '1') {
this.agentcontrol = true
} else if (this.personalForm.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.customerName
this.personalForm.customerPhone = val.phoneNumber
},
agentdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.agentName
this.personalForm.customerPhone = val.phone
},
//
handleAddproduct() {
this.categoryVisible = true
this.handleItemChange()
},
deleteChange(val) {
this.choosedata = val
},
//
updatecountry() {
this.getTypes()
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.salePersonId = val.personName
this.personalForm.salePersonId = val.id
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.repositoryId
this.roleId = val.postName
this.personalForm.roleId = val.postId
},
//
restAllForm() {
this.personalForm = {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2
}
this.customerId = null
this.salePersonId = null
},
// //
// handlesave() {
// const EnterDetail = this.$refs.editable.getRecords()
// if (EnterDetail.length === 0) {
// this.$notify.error({
// title: '',
// message: '',
// offset: 100
// })
// return false
// }
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
// delete elem.batch
// }
// if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
// delete elem.productName
// }
// if (elem.category === null || elem.category === '' || elem.category === undefined) {
// delete elem.category
// }
// if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
// delete elem.unit
// }
// if (elem.type === null || elem.type === '' || elem.type === undefined) {
// delete elem.type
// }
// if (elem.color === null || elem.color === '' || elem.color === undefined) {
// delete elem.color
// }
// if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
// delete elem.kpiGrade
// }
// if (elem.point === null || elem.point === '' || elem.point === undefined) {
// delete elem.point
// }
// if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
// delete elem.salePrice
// }
// if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
// delete elem.costPrice
// }
// if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
// delete elem.costMoney
// }
// if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
// delete elem.includeTaxMoney
// }
// if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
// delete elem.taxRate
// }
// if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
// elem.taxRate = elem.taxRate / 100
// }
// if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
// delete elem.taxMoney
// }
// if (elem.money === null || elem.money === '' || elem.money === undefined) {
// delete elem.money
// }
// if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
// delete elem.includeTaxCostMoney
// }
// if (elem.discount === null || elem.discount === '' || elem.discount === undefined) {
// delete elem.discount
// }
// if (elem.discount !== null || elem.discount !== '' || elem.discount !== undefined) {
// elem.discount = elem.discount / 100
// }
// if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
// delete elem.discountMoney
// }
// if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
// delete elem.alreadyReturnQuantity
// }
// if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
// delete elem.returnQuantity
// }
// if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) {
// delete elem.returnReason
// }
// if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) {
// delete elem.sendQuantity
// }
// if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
// delete elem.carCode
// }
// if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
// delete elem.motorCode
// }
// if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
// delete elem.batteryCode
// }
// if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
// delete elem.locationId
// }
// return elem
// })
// const parms2 = JSON.stringify(EnterDetail)
// const Data = this.personalForm
// for (const key in Data) {
// if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
// delete Data[key]
// }
// }
// const parms = JSON.stringify(Data)
// this.$refs.personalForm.validate((valid) => {
// if (valid) {
// createSalePlan(parms, parms2, this.personalForm).then(res => {
// console.log(res)
// if (res.data.ret === 200) {
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// offset: 100
// })
// this.restAllForm()
// this.$refs.editable.clear()
// this.$refs.personalForm.clearValidate()
// this.$refs.personalForm.resetFields()
// this.$refs.personalForm2.clearValidate()
// this.$refs.personalForm2.resetFields()
// this.$refs.personalForm3.clearValidate()
// this.$refs.personalForm3.resetFields()
// } else {
// this.$notify.error({
// title: '',
// message: res.data.msg,
// offset: 100
// })
// }
// })
// } else {
// this.$notify.error({
// title: '',
// message: '',
// offset: 100
// })
// return false
// }
// })
// },
//
handlecancel() {
this.$router.go(-1)
const view = { path: '/SalePlan/AddSalePlan', name: 'AddSalePlan', fullPath: '/SalePlan/AddSalePlan', title: 'AddSalePlan' }
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
})
}
}
}
</script>
<style rel="stylesheet/css" scoped>
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
.ERP-container {
margin-right: 0;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 20px;
}
.container{
margin-top: 40px;
}
.el-button+.el-button{
width: 98px;
}
</style>

View file

@ -0,0 +1,416 @@
<template>
<el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.number +' 详情'" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<span>{{ personalForm.title }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<span>{{ personalForm.sourceType | sourceTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<span>{{ personalForm.sourceNumber }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<span>{{ personalForm.customerType | customerTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<span>{{ personalForm.customerName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<span>{{ personalForm.customerPhone }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<span>{{ personalForm.closeTypeName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<span>{{ personalForm.payType | payTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<span>{{ personalForm.salePersonName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<span>{{ personalForm.saleRepositoryName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<span>{{ personalForm.receiveAddress }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<span>{{ personalForm.returnDate }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<span>{{ personalForm.currency | currencyFilter }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">退货明细</h2>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
class="click-table1"
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="locationName" align="center" label="货位" min-width="150px"/>
<el-editable-column prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="150px"/>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column prop="returnQuantity" align="center" label="退货数量" min-width="150px"/>
<el-editable-column prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<span>{{ personalForm.allQuantity }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<span>{{ personalForm.allMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<span>{{ personalForm.allIncludeTaxMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<span>{{ personalForm.allTaxMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<span>{{ personalForm.allDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<span>{{ personalForm.allIncludeTaxDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<span>{{ personalForm.ridMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<span>{{ personalForm.actualReturnMoney }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">相关单据状态</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm3" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<span>{{ personalForm.closeStatusId | closeStatusIdFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<span>{{ personalForm.alreadyMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<span>{{ personalForm.enterStatusId | enterStatusIdFilter }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--审核状态-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name">审核状态</h2>
<el-steps :active="reviewList.length" direction="vertical">
<el-step
v-for="(item, index) in reviewList"
:key="index"
:title="'审核步骤' + item.step"
style="height: 100px">
<template slot="description" >
<span style="font-size: 16px;color: red">{{ item.stat | statfilter }}</span><br>
<span style="font-size: 14px">审核人: {{ item.stepHandlerName }}</span><br>
<span style="font-size: 14px">审核时间: {{ item.createTime }}</span>
</template>
</el-step>
</el-steps>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">备注信息</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('public.receiptStat')" style="width: 100%;">
{{ personalForm.receiptStat | receiptStatFilter }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.createPersonName')" prop="stockType" style="width: 100%;">
{{ personalForm.createPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.createDate')" style="width: 100%;">
{{ personalForm.createDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.judgePersonName')" prop="applyDeptId" style="width: 100%;">
{{ personalForm.judgePersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.judgeDate')" prop="sourceType" style="width: 100%;">
{{ personalForm.judgeDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.endPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.endDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyDate }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
</el-dialog>
</template>
<script>
export default {
filters: {
currencyFilter(status) {
const statusMap = {
1: 'RMB',
2: 'USD'
}
return statusMap[status]
},
payTypeFilter(status) {
const statusMap = {
1: '货到付款',
2: '当场支付'
}
return statusMap[status]
},
closeStatusIdFilter(status) {
const statusMap = {
1: '已结算',
2: '未结算'
}
return statusMap[status]
},
enterStatusIdFilter(status) {
const statusMap = {
1: '已入库',
2: '未入库'
}
return statusMap[status]
},
customerTypeFilter(status) {
const statusMap = {
1: '经销商',
2: '零售商'
}
return statusMap[status]
},
statfilter(status) {
const statusMap = {
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: '销售出库单',
2: '无来源'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
}
},
props: {
detailcontrol: {
type: Boolean,
default: false
},
detaildata: {
type: Object,
default: null
}
},
data() {
return {
//
heji1: '',
heji2: '',
//
reviewList: [],
//
list2: [],
list3: [],
//
editVisible: this.detailcontrol,
//
personalForm: this.detaildata
}
},
watch: {
detailcontrol() {
this.editVisible = this.detailcontrol
},
detaildata() {
this.personalForm = this.detaildata
this.list2 = this.personalForm.saleReturnDetailVos
this.reviewList = this.personalForm.approvalUseVos
}
},
methods: {
handlecancel() {
this.editVisible = false
}
}
}
</script>
<style scoped>
.edit >>> .el-dialog{
-webkit-transform: none;
transform: none;
position: absolute;
right: 0;
left: auto;
height: auto;
}
.edit >>> .el-dialog__header{
background: #fff;
position: fixed;
top: 0;
display: block;
width: 1010px;
z-index: 100;
border-bottom: 1px solid #f1f1f1;
}
.edit >>> .el-dialog__body{
padding-left: 0;
padding-right: 0;
padding-top: 10px;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
}
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -0,0 +1,357 @@
<template>
<el-dialog :visible.sync="employeeVisible" :agentcontrol="agentcontrol" :close-on-press-escape="false" top="10px" title="选择经销商" append-to-body width="1100px" @close="$emit('update:agentcontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.agentname" :placeholder="$t('Customer.agentname')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.phone" :placeholder="$t('Customer.phone')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-date-picker
v-model="getemplist.createtime"
type="date"
class="filter-item"
placeholder="选择日期"
value-format="yyyy-MM-dd"/>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Customer.customertype')" clearable style="width: 40%;float: left;margin-left: 20px;">
<el-option
v-for="(item, index) in customertypes"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.level" :value="getemplist.level" :placeholder="$t('Customer.level')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable>
<el-option
v-for="(item, index) in levels"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-input v-model="getemplist.contactname" :placeholder="$t('Customer.contactname')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable />
<el-input v-model="getemplist.pinyin" :placeholder="$t('Customer.pinyin')" style="width: 40%;float: right;margin-right: 20px;margin-top: 20px" clearable />
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.agentname')" :resizable="false" prop="agentName" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.agentName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customertype')" :resizable="false" prop="agentType" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.agentType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.level')" :resizable="false" prop="agentLevel" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.agentLevel }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.traderid')" :resizable="false" prop="traderName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.traderName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.contactname')" :resizable="false" prop="contactName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.contactName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.phone')" :resizable="false" prop="phone" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.phone }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createName')" :resizable="false" prop="createName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createTime')" :resizable="false" prop="createTime" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { searchCusCategory, agentlist } from '@/api/Customer'
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]
},
filterno(status) {
const statusMap = {
1: '老客户',
2: '新客户'
}
return statusMap[status]
}
},
props: {
agentcontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.agentcontrol,
//
visible2: false,
//
customertypes: [],
customertyp: 1,
//
//
levels: [],
levelstype: 2,
//
//
sources: [],
sourcestype: 3,
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
agentname: '',
phone: '',
type: '',
pinyin: '',
level: '',
pagenum: 1,
pagesize: 10,
contactname: '',
source: '',
createtime: ''
},
//
customerForm: {
agentname: '',
phone: '',
type: '',
pinyin: '',
level: '',
source: '',
discount: '',
countryid: '',
provinceid: '',
cityid: '',
introduce: '',
address: '',
contactname: '',
traderid: '',
transmode: '',
deliverymode: '',
createid: '',
newold: ''
}
}
},
watch: {
agentcontrol() {
this.employeeVisible = this.agentcontrol
}
},
mounted() {
this.getlist()
this.getCategory()
},
methods: {
//
getCategory() {
//
searchCusCategory(this.customertyp).then(res => {
if (res.data.ret === 200) {
this.customertypes = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
//
searchCusCategory(this.levelstype).then(res => {
if (res.data.ret === 200) {
this.levels = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
//
searchCusCategory(this.sourcestype).then(res => {
if (res.data.ret === 200) {
this.sources = res.data.data.content.list
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
getlist() {
//
this.listLoading = true
agentlist(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() {
this.getemplist.pagenum = 1
agentlist(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.$router.push('/Customer/NewAgent')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
this.$emit('agentdata', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,368 @@
<template>
<el-dialog :visible.sync="employeeVisible" :applycontrol="applycontrol" :close-on-press-escape="false" top="10px" title="选择采购申请单" append-to-body width="1100px" @close="$emit('update:applycontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.title" :placeholder="$t('StockApply.title')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.applyNumber" placeholder="单据编号" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-input v-model="applyPersonId" :placeholder="$t('StockApply.applyPersonId')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechooseStock"/>
</el-form-item>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.applyDeptId" placeholder="申请部门" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option
v-for="(item, index) in depts"
:key="index"
:value="item.id"
:label="item.deptName"/>
</el-select>
<el-select v-model="getemplist.stockType" style="width: 40%;float: right;margin-right: 20px" clearable @focus="updatecountry">
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" placeholder="审批状态" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option value="0" label="未审核"/>
<el-option value="1" label="审核中"/>
<el-option value="2" label="审核通过"/>
<el-option value="3" label="审核不通过"/>
</el-select>
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" placeholder="单据状态" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option value="1" label="制单"/>
<el-option value="2" label="执行"/>
<el-option value="3" label="结单"/>
</el-select>
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
unlink-panels
start-placeholder="Start"
end-placeholder="End"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.title')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.stockType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stockType | stockTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.sourceType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyPersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyDeptId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyDeptName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockApply.applyDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.applyDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { stocapplylist } from '@/api/StockApply'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyEmp from '../../StockApply/components/MyEmp'
export default {
directives: { waves },
components: { MyEmp, Pagination },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: '未审核',
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: '无来源'
}
return statusMap[status]
}
},
props: {
applycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.applycontrol,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
types: [],
//
depts: [],
//
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
},
//
detailvisible: false,
//
visible2: false,
//
applyPersonId: '',
//
stockControl: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: 438,
regionIds: 2,
createPersonId: 3
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
applycontrol() {
this.employeeVisible = this.applycontrol
}
},
created() {
this.getlist()
},
methods: {
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
stocapplylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
searchStockCategory(this.typeparms).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
//
restFilter() {
this.applyPersonId = ''
this.getemplist.applyPersonId = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
stocapplylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.applyPersonId = val.personName
this.getemplist.applyPersonId = val.id
},
//
handleAdd() {
this.$router.push('/StockApply/AddStockApply')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const applydata = this.choosedata.stockApplyDetailVos
const number = this.choosedata.applyNumber
const applyDetail = applydata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productType: item.productType,
typeId: item.typeId,
unit: item.unit,
color: item.color,
basicQuantity: item.applyQuantity,
planDeliveryDate: item.requireDate,
applyReason: item.applyReason,
sourceNumber: number,
supplierId: '',
supplierName: '',
basicPrice: ''
}
})
this.$emit('apply', applyDetail)
this.$emit('apply2', applyDetail)
this.$emit('allinfo', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,365 @@
<template>
<el-dialog :visible.sync="employeeVisible" :customercontrol="customercontrol" :close-on-press-escape="false" top="10px" title="选择客户" append-to-body width="1100px" @close="$emit('update:customercontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.customername" :placeholder="$t('Customer.customername')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.customerphone" :placeholder="$t('Customer.phone')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Customer.customertype')" clearable>
<el-option
v-for="(item, index) in customertypes"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.source" :value="getemplist.source" :placeholder="$t('Customer.source')" clearable style="width: 40%;float: left;margin-left: 20px;">
<el-option
v-for="(item, index) in sources"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</el-select>
<el-select v-model="getemplist.repositoryid" placeholder="请选择门店" filterable clearable 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.level" :placeholder="$t('Customer.level')" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option
v-for="(item, index) in levels"
:key="index"
:value="item.id"
:label="item.categoryName"/>
</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" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customername')" :resizable="false" align="center" width="80">
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.customertype')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.customerTypeWZ }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.level')" :resizable="false" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.customerLevel }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.birthday')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.birthday }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.source')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.source }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.newold')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.newOrOld | filterno }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.phone')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.gender')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.gender | genderFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.address')" :resizable="true" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.address }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.point')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.point }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Customer.createTime')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { searchRepository } from '@/api/public'
import { searchCusCategory, customerlist } from '@/api/Customer'
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]
},
filterno(status) {
const statusMap = {
1: '老客户',
2: '新客户'
}
return statusMap[status]
}
},
props: {
customercontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.customercontrol,
//
visible2: false,
//
//
customertypes: [],
customertyp: 1,
//
//
levels: [],
levelstype: 2,
//
//
sources: [],
sourcestype: 3,
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
customername: '',
customerphone: '',
level: '',
createtime: '',
type: '',
pagenum: 1,
pagesize: 10,
repositoryid: '',
source: ''
},
//
depts: [],
//
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions: [],
getemplistregions: [],
//
repositories: []
}
},
watch: {
customercontrol() {
this.employeeVisible = this.customercontrol
}
},
mounted() {
this.getlist()
this.getCategory()
},
methods: {
//
getCategory() {
//
searchCusCategory(this.customertyp).then(res => {
if (res.data.ret === 200) {
this.customertypes = res.data.data.content.list
} else {
console.log('客户类型出错')
}
})
//
searchCusCategory(this.levelstype).then(res => {
if (res.data.ret === 200) {
this.levels = res.data.data.content.list
} else {
console.log('客户优质级别出错')
}
})
//
searchCusCategory(this.sourcestype).then(res => {
if (res.data.ret === 200) {
this.sources = res.data.data.content.list
} else {
console.log('客户来源出错')
}
})
//
searchRepository().then(res => {
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
console.log('门店出错')
}
})
},
getlist() {
//
this.listLoading = true
customerlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
} else {
console.log('员工列表出错')
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
},
//
handleFilter() {
this.getemplist.pagenum = 1
customerlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
} else {
console.log('搜索出错')
}
})
},
//
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('出错了')
}
})
},
//
handleAdd() {
this.$router.push('/Customer/NewCustomer')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
this.$emit('customerdata', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,326 @@
<template>
<el-dialog :visible.sync="employeeVisible" :deliverycontrol="deliverycontrol" :close-on-press-escape="false" top="10px" title="选择员工" append-to-body @close="$emit('update:deliverycontrol', 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
v-for="(item, index) in jobs"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</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>
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">确认添加</el-button>
<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, searchEmpCategory } 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: {
deliverycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
jobCat: {
type: 2,
pagenum: 1,
pagesize: 9999
},
//
jobs: [],
//
choosedata: '',
//
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.deliverycontrol,
//
regionManagerVisible: false
}
},
watch: {
deliverycontrol() {
this.employeeVisible = this.deliverycontrol
}
},
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
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
}
})
//
searchEmpCategory(this.jobCat).then(res => {
if (res.data.ret === 200) {
this.jobs = res.data.data.content.list
} else {
console.log('职位列表出错')
}
})
},
//
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
}
})
},
//
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.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('deliveryName', this.choosedata)
}
//
}
}
</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>

View file

@ -0,0 +1,313 @@
<template>
<el-dialog :visible.sync="productVisible" :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.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.productname" :placeholder="$t('Product.productname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="supplierid" :placeholder="$t('Product.supplierid')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
<el-input v-model="categoryid" placeholder="物品分类" class="filter-item" clearable @focus="treechoose"/>
<my-tree :treecontrol.sync="treecontrol" @tree="tree"/>
<!-- 更多搜索条件下拉栏 -->
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.typeid" placeholder="请选择规格型号" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
<el-select v-model="getemplist.isactive" placeholder="请选择上下架" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option value="1" label="上1"/>
<el-option value="2" label="下2"/>
</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" @click="visible2 = !visible2">{{ $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"
: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('Product.code')" :resizable="false" prop="code" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.productname')" :resizable="false" prop="ProductName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.categoryid')" :resizable="false" prop="category" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.category }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.typeid')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.color')" :resizable="false" prop="color" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.kpigrade')" :resizable="false" prop="kpiGrade" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.kpiGrade }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.point')" :resizable="false" prop="point" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.point }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.costprice')" :resizable="false" prop="costPrice" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.costPrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.purchaseprice')" :resizable="false" prop="purchasePrice" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.purchasePrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createid')" :resizable="false" prop="createName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createTime')" :resizable="false" prop="createTime" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" style="padding: 0" @pagination="getlist" />
<span slot="footer" class="dialog-footer">
<el-button v-waves type="success" style="text-align: center;" @click="handleAddTo">确认添加</el-button>
</span>
</el-dialog>
</template>
<script>
import { productlist, searchEmpCategory2 } from '@/api/Product'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MySupplier from '../../Product/components/MySupplier'
import MyTree from '../../Product/components/MyTree' // Secondary package based on el-pagination
export default {
directives: { waves },
components: { MyTree, MySupplier, Pagination },
filters: {
genderFilter(status) {
const statusMap = {
1: '男',
2: '女'
}
return statusMap[status]
}
},
props: {
control: {
type: Boolean,
default: false
}
},
data() {
return {
//
supplierid: '',
//
empcontrol: false,
//
types: [],
//
treecontrol: false,
//
categoryid: '',
//
productVisible: this.control,
//
visible2: false,
//
moreaction: '',
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
productid: '',
code: '',
productname: '',
categoryid: '',
typeid: '',
isactive: '',
Productid: '',
pagenum: 1,
pagesize: 10
}
}
},
watch: {
control() {
this.productVisible = this.control
console.log(this.control)
this.getlist()
}
},
created() {
this.getlist()
},
methods: {
getlist() {
//
this.listLoading = true
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
searchEmpCategory2(2).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
restFilter() {
this.categoryid = ''
this.getemplist.categoryid = ''
this.supplierid = ''
this.getemplist.supplierid = ''
},
//
handleFilter() {
this.getemplist.pagenum = 1
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
//
handleSelectionChange(val) {
this.moreaction = val
},
// focus
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierid = val.supplierName
this.getemplist.supplierid = val.id
},
// focus
treechoose() {
this.treecontrol = true
},
//
tree(val) {
this.categoryid = val.categoryName
this.getemplist.categoryid = val.id
},
//
handleAdd() {
this.$router.push('/Product/NewProduct')
this.productVisible = false
},
//
handleAddTo() {
this.productVisible = false
console.log(this.moreaction)
const productDetail = this.moreaction.map(function(item) {
return {
productCode: item.code,
productName: item.productName,
Categoryid: item.category,
productCategory: item.categoryId,
productType: item.typeId,
typeId: item.productType,
color: item.color,
unit: item.purMeasu,
performanceScore: item.kpiGrade,
productScore: item.point,
quantity: 0,
salePrice: item.salePrice,
costPrice: item.costPrice,
costMoney: 0,
includeTaxMoney: 0,
taxRate: 0,
taxMoney: 0,
money: 0,
includeTaxCostMoney: 0,
discount: 0,
discountMoney: 0,
taxprice: 0
}
})
console.log(productDetail)
this.$emit('product', productDetail)
}
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 150px;
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>

View file

@ -0,0 +1,717 @@
<template>
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.number +' 修改'" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseSource">
<el-option value="1" label="销售出库单"/>
<el-option value="2" label="无来源"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<el-select v-model="personalForm.closeType" style="margin-left: 18px;width: 200px">
<el-option
v-for="(item, index) in colseTypes"
:value="item.id"
:key="index"
:label="item.categoryName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<el-select v-model="personalForm.payType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<el-input v-model="saleRepositoryId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<el-input v-model="personalForm.receiveAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<el-date-picker
v-model="personalForm.returnDate"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<el-select v-model="personalForm.currency" style="margin-left: 18px;width: 200px">
<el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >退货明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
show-summary
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="locationId" align="center" label="货位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="150px"/>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="returnQuantity" align="center" label="退货数量" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.returnQuantity"
@change="getquantity(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', attrs: {min: 0}, type: 'visible'}" prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<el-input v-model="heji1" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<el-input v-model="heji2" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<el-input v-model="heji3" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<el-input v-model="heji4" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<el-input v-model="heji5" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<el-input v-model="heji6" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<el-input v-model="personalForm.ridMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<el-input v-model="personalForm.actualReturnMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">相关单据状态</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<el-select v-model="personalForm.closeStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label="已结算"/>
<el-option value="2" label="未结算"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<el-input v-model="personalForm.alreadyMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<el-select v-model="personalForm.enterStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label="已入库"/>
<el-option value="2" label="未入库"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">取消</el-button>
<el-button type="primary" @click="handleEditok()">保存</el-button>
</div>
</el-card>
</el-dialog>
</template>
<script>
import { updatesaleReturn } from '@/api/SaleReturn'
import { searchSaleCategory } from '@/api/SaleCategory'
import MyEmp from './MyEmp'
import MyDelivery from './MyDelivery'
import MyDetail from './MyDetail'
import MyApply from './MyApply'
import MyRequire from './MyRequire'
import MyCustomer from './MyCustomer'
import MyAgent from './MyAgent'
export default {
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
props: {
editcontrol: {
type: Boolean,
default: false
},
editdata: {
type: Object,
default: null
}
},
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (value === '') {
callback(new Error('请选择'))
} else {
callback()
}
}
return {
//
choosedata: [],
//
editVisible: this.editcontrol,
//
personalForm: this.editdata,
//
heji1: '',
heji2: '',
heji3: '',
heji4: '',
heji5: '',
heji6: '',
heji7: '',
heji8: '',
heji9: '',
//
IsNumber: true,
//
Isproduct: true,
//
saleRepositoryId: '',
//
customerId: '',
//
customercontrol: false,
agentcontrol: false,
//
salePersonId: '',
//
stockControl: false,
//
colseTypes: [],
//
colseTypeparms: {
type: 3,
pagenum: 1,
pagesize: 99999,
iseffective: 1
},
//
control: false,
//
personalrules: {
customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' }
],
customerName: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
returnDate: [
{ required: true, message: '请选择退货日期', trigger: 'change' }
],
currency: [
{ required: true, message: '请选择币种', trigger: 'change' }
],
sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' }
],
closeStatusId: [
{ required: true, message: '请选择结算状态', trigger: 'change' }
]
},
//
list2: [],
//
list3: [],
//
validRules: {
}
}
},
watch: {
editcontrol() {
this.editVisible = this.editcontrol
},
editdata() {
this.personalForm = this.editdata
this.salePersonId = this.personalForm.salePersonName
this.customerId = this.personalForm.customerName
this.saleRepositoryId = this.personalForm.saleRepositoryName
this.personalForm.customerPhone = this.personalForm.phoneNumber
this.list2 = this.personalForm.saleReturnDetailVos
this.chooseSource()
}
},
created() {
this.getTypes()
},
methods: {
getTypes() {
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
//
chooseSource(val) {
if (val === '1') {
this.Isproduct = true
this.IsNumber = false
} else if (val === '2') {
this.Isproduct = false
this.IsNumber = true
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return (prev).toFixed(2)
}
}, 0)
sums[index] += ''
} else {
sums[index] = ''
}
})
sums[2] = ''
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = ''
sums[7] = ''
sums[8] = ''
sums[9] = ''
sums[25] = ''
sums[27] = ''
sums[28] = ''
sums[29] = ''
sums[30] = ''
this.heji1 = sums[24]
this.heji2 = sums[19]
this.heji3 = sums[16]
this.heji4 = sums[18]
this.heji5 = sums[22]
this.heji6 = sums[20] - sums[22]
return sums
},
//
getdiscountMoney(row) {
row.discount = ((1 - row.discountMoney / row.salePrice / row.quantity) * 100).toFixed(2)
},
//
getdiscount(row) {
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2)
},
getquantity(row) {
row.costMoney = row.returnQuantity * row.costPrice
row.taxprice = row.salePrice * (1 + row.taxRate / 100)
row.includeTaxMoney = row.returnQuantity * row.taxprice
row.money = row.returnQuantity * row.salePrice
row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney
row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.returnQuantity).toFixed(2)
if (row.returnQuantity !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.returnQuantity)) * 100).toFixed(2)
row.discount = (1 - row.discountMoney / row.salePrice / row.returnQuantity).toFixed(2)
}
row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
return row.returnQuantity
},
//
gettaxprice(row) {
row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(2)
return row.taxprice
},
//
gettaxRate(row) {
if (row.taxRate !== 0) {
row.taxMoney = (row.salePrice * row.taxRate * row.quantity / 100).toFixed(2)
}
return row.taxRate
},
//
gettaxMoney(row) {
if (row.taxMoney !== 0 && row.quantity !== 0 && row.salePrice !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2)
}
return row.taxMoney
},
//
clearCustomer() {
this.personalForm.customerId = ''
this.customerId = ''
},
// focus
chooseCustomer() {
if (this.personalForm.customerType === '1') {
this.agentcontrol = true
} else if (this.personalForm.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.customerName
this.personalForm.customerPhone = val.phoneNumber
},
agentdata(val) {
this.personalForm.customerId = val.id
this.customerId = val.agentName
this.personalForm.customerPhone = val.phone
},
//
handleAddproduct() {
this.control = true
},
productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
deleteChange(val) {
this.choosedata = val
},
//
updatecountry() {
this.getTypes()
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.salePersonId = val.personName
this.personalForm.salePersonId = val.id
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.repositoryId
this.roleId = val.postName
this.personalForm.roleId = val.postId
},
//
restAllForm() {
this.personalForm = {
createPersonId: 3,
countryId: 1,
repositoryId: 438,
regionId: 2
}
this.customerId = null
this.salePersonId = null
},
//
//
handleEditok() {
this.personalForm.repositoryId = 438
this.personalForm.regionId = 2
this.personalForm.createPersonId = 3
this.personalForm.countryId = 1
this.personalForm.modifyPersonId = 3
const EnterDetail = this.$refs.editable.getRecords()
if (EnterDetail.length === 0) {
this.$notify.error({
title: '错误',
message: '明细表不能为空',
offset: 100
})
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discount === null || elem.discount === '' || elem.discount === undefined) {
delete elem.discount
}
if (elem.discount !== null || elem.discount !== '' || elem.discount !== undefined) {
elem.discount = elem.discount / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
delete elem.alreadyReturnQuantity
}
if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
delete elem.returnQuantity
}
if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) {
delete elem.returnReason
}
if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) {
delete elem.sendQuantity
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
delete elem.locationId
}
return elem
})
const parms2 = JSON.stringify(EnterDetail)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
const parms = JSON.stringify(Data)
updatesaleReturn(parms, parms2).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: '操作成功',
message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
handlecancel() {
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
}
// -------------------------------------------------
}
}
</script>
<style scoped>
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -0,0 +1,332 @@
<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
v-for="(item, index) in jobs"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</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>
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">确认添加</el-button>
<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, searchEmpCategory } 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 {
//
jobCat: {
type: 2,
pagenum: 1,
pagesize: 9999
},
//
jobs: [],
//
choosedata: '',
//
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
}
},
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
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
}
})
//
searchEmpCategory(this.jobCat).then(res => {
if (res.data.ret === 200) {
this.jobs = res.data.data.content.list
} else {
console.log('职位列表出错')
}
})
},
//
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.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('stockName', this.choosedata)
}
//
}
}
</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>

View file

@ -0,0 +1,331 @@
<template>
<el-dialog :visible.sync="employeeVisible" :requirecontrol="requirecontrol" :close-on-press-escape="false" top="10px" title="选择采购需求单" append-to-body width="1100px" @close="$emit('update:requirecontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="categoryId" :placeholder="$t('StockRequire.categoryId')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="treechoose"/>
<my-tree :treecontrol.sync="treecontrol" @tree="tree"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.productName" placeholder="物料名称" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handleAddproduct"/>
<my-detail :control.sync="control" @productdata="productdata"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-select v-model="getemplist.isPlan" :value="getemplist.isPlan" class="filter-item" placeholder="是否已生成采购计划" clearable>
<el-option value="1" label="是"/>
<el-option value="2" label="否"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
unlink-panels
start-placeholder="需求日期开始"
end-placeholder="需求日期结束"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<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('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.materialsRequireNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productName')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productCode')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productCode }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.categoryId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productCategory }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.productType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.color')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.unit')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.unit }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.requireQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.requireQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.inventoryQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.inventoryQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.shouldStockQuantity')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.shouldStockQuantity }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.stockAdvanceday')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stockAdvanceday }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.requireDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.requireDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockRequire.isPlan')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.isPlaned | isPlanedFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { stockrequirelist } from '@/api/StockRequire'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyTree from '../../Product/components/MyTree'
import MyDetail from '../../StockRequire/components/MyDetail'
export default {
directives: { waves },
components: { MyDetail, MyTree, Pagination },
filters: {
isPlanedFilter(status) {
const statusMap = {
1: '是',
2: '否'
}
return statusMap[status]
}
},
props: {
requirecontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.requirecontrol,
//
choosedata: '',
//
control: false,
//
categoryId: '',
//
treecontrol: false,
//
detailvisible: false,
//
visible2: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: 438,
regionIds: 2,
createPersonId: 3
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
requirecontrol() {
this.employeeVisible = this.requirecontrol
}
},
created() {
this.getlist()
},
methods: {
// focus
handleAddproduct() {
this.control = true
},
//
productdata(val) {
this.getemplist.productName = val.productName
},
// focus
treechoose() {
this.treecontrol = true
},
//
tree(val) {
this.categoryId = val.categoryName
this.getemplist.categoryId = val.id
},
getlist() {
//
this.listLoading = true
stockrequirelist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
},
//
restFilter() {
this.handlePersonId = ''
this.getemplist.handlePersonId = ''
this.workCenterId = ''
this.getemplist.workCenterId = ''
this.producePlanNumber = ''
this.getemplist.producePlanNumber = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
if (this.date === null || this.date === '') {
this.getemplist.beginTime = null
this.getemplist.endTime = null
} else {
this.getemplist.beginTime = this.date[0]
this.getemplist.endTime = this.date[1]
}
stockrequirelist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
//
handleSelectionChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const requiredata = this.choosedata
const requireDetail = requiredata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productType: item.productType,
typeId: item.typeId,
unit: item.unit,
color: item.color,
basicQuantity: item.requireQuantity,
planDeliveryDate: item.requireDate,
applyReason: '',
sourceNumber: item.materialsRequireNumber,
supplierId: '',
supplierName: '',
basicPrice: ''
}
})
this.$emit('require', requireDetail)
this.$emit('require2', requireDetail)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -65,7 +65,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.salePersonId')" prop="salePersonId" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="salePersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
@ -124,8 +124,18 @@
style="width: 100%"> style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/> <el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/> <el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="locationId" align="center" label="货位" min-width="150px"/> <el-editable-column :edit-render="{type: 'visible'}" prop="locationId" align="center" label="货位" min-width="170px">
<el-editable-column prop="batch" align="center" label="批次" min-width="150px"/> <template slot="edit" slot-scope="scope">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" placeholder="请选择货位" filterable clearable style="width: 100%;" @visible-change="updatebatch($event,scope)">
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/> <el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="Categoryid" align="center" label="物品分类" min-width="150px"/> <el-editable-column prop="Categoryid" align="center" label="物品分类" min-width="150px"/>
@ -146,7 +156,14 @@
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/> <el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/> <el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="returnQuantity" align="center" label="退货数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="returnQuantity" align="center" label="退货数量" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.returnQuantity"
@change="getquantity(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', attrs: {min: 0}, type: 'visible'}" prop="returnReason" align="center" label="退货原因" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInput', attrs: {min: 0}, type: 'visible'}" prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/> <el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/> <el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
@ -245,8 +262,9 @@
</template> </template>
<script> <script>
// import { createSaleReturn } from '@/api/SaleOrder' import { createsaleReturn } from '@/api/SaleReturn'
import { searchSaleCategory } from '@/api/SaleCategory' import { searchSaleCategory } from '@/api/SaleCategory'
import { getlocation, locationlist } from '@/api/public'
import MyEmp from './components/MyEmp' import MyEmp from './components/MyEmp'
import MyDelivery from '../DailyAdjust/components/MyDelivery' import MyDelivery from '../DailyAdjust/components/MyDelivery'
import MyDetail from './components/MyDetail' import MyDetail from './components/MyDetail'
@ -277,6 +295,8 @@ export default {
heji7: '', heji7: '',
heji8: '', heji8: '',
heji9: '', heji9: '',
//
locationlist: [],
// //
IsNumber: true, IsNumber: true,
// //
@ -300,7 +320,8 @@ export default {
colseTypeparms: { colseTypeparms: {
type: 3, type: 3,
pagenum: 1, pagenum: 1,
pagesize: 99999 pagesize: 99999,
iseffective: 1
}, },
// //
control: false, control: false,
@ -317,7 +338,10 @@ export default {
customerType: [ customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' } { required: true, message: '请选择客户类别', trigger: 'change' }
], ],
customerName: [ salePersonId: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
customerId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'focus' }
], ],
returnDate: [ returnDate: [
@ -346,6 +370,39 @@ export default {
this.getTypes() this.getTypes()
}, },
methods: { methods: {
updatebatch(event, scope) {
if (event === true) {
if (this.personalForm.saleRepositoryId === undefined || this.personalForm.saleRepositoryId === '') {
this.$notify.error({
title: '错误',
message: '请先选择仓库',
offset: 100
})
return false
}
getlocation(this.personalForm.saleRepositoryId, scope.row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.saleRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
}
},
getTypes() {
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
// //
chooseSource(val) { chooseSource(val) {
if (val === '1') { if (val === '1') {
@ -411,17 +468,17 @@ export default {
}, },
// //
getquantity(row) { getquantity(row) {
row.costMoney = row.quantity * row.costPrice row.costMoney = row.returnQuantity * row.costPrice
row.includeTaxMoney = row.quantity * row.taxprice row.includeTaxMoney = row.returnQuantity * row.taxprice
row.money = row.quantity * row.salePrice row.money = row.returnQuantity * row.salePrice
row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney
row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.quantity).toFixed(2) row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.returnQuantity).toFixed(2)
if (row.quantity !== 0) { if (row.returnQuantity !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2) row.taxRate = ((row.taxMoney / (row.salePrice * row.returnQuantity)) * 100).toFixed(2)
row.discount = (1 - row.discountMoney / row.salePrice / row.quantity).toFixed(2) row.discount = (1 - row.discountMoney / row.salePrice / row.returnQuantity).toFixed(2)
} }
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount)).toFixed(2) row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
return row.quantity return row.returnQuantity
}, },
// //
gettaxprice(row) { gettaxprice(row) {
@ -492,20 +549,6 @@ export default {
updatecountry() { updatecountry() {
this.getTypes() this.getTypes()
}, },
getTypes() {
//
searchSaleCategory(this.invoicetypeparms).then(res => {
if (res.data.ret === 200) {
this.invoiceTypes = res.data.data.content.list
}
})
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
// focus // focus
handlechooseStock() { handlechooseStock() {
this.stockControl = true this.stockControl = true
@ -515,7 +558,7 @@ export default {
this.salePersonId = val.personName this.salePersonId = val.personName
this.personalForm.salePersonId = val.id this.personalForm.salePersonId = val.id
this.saleRepositoryId = val.repositoryName this.saleRepositoryId = val.repositoryName
this.personalForm.repositoryName = val.repositoryId this.personalForm.saleRepositoryId = val.repositoryId
this.roleId = val.postName this.roleId = val.postName
this.personalForm.roleId = val.postId this.personalForm.roleId = val.postId
}, },
@ -530,144 +573,151 @@ export default {
this.customerId = null this.customerId = null
this.salePersonId = null this.salePersonId = null
}, },
// // //
// handlesave() { handlesave() {
// const EnterDetail = this.$refs.editable.getRecords() const EnterDetail = this.$refs.editable.getRecords()
// const EnterDetail2 = this.$refs.editable2.getRecords() if (EnterDetail.length === 0) {
// if (EnterDetail.length === 0) { this.$notify.error({
// this.$notify.error({ title: '错误',
// title: '', message: '明细表不能为空',
// message: '', offset: 100
// offset: 100 })
// }) return false
// return false }
// } EnterDetail.map(function(elem) {
// EnterDetail.map(function(elem) { return elem
// return elem }).forEach(function(elem) {
// }).forEach(function(elem) { if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
// if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) { delete elem.batch
// delete elem.productCode }
// } if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
// if (elem.productName === null || elem.productName === '' || elem.productName === undefined) { delete elem.productName
// delete elem.productName }
// } if (elem.category === null || elem.category === '' || elem.category === undefined) {
// if (elem.typeId === null || elem.typeId === '' || elem.typeId === undefined) { delete elem.category
// delete elem.typeId }
// } if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
// if (elem.unit === null || elem.unit === '' || elem.unit === undefined) { delete elem.unit
// delete elem.unit }
// } if (elem.type === null || elem.type === '' || elem.type === undefined) {
// if (elem.color === null || elem.color === '' || elem.color === undefined) { delete elem.type
// delete elem.color }
// } if (elem.color === null || elem.color === '' || elem.color === undefined) {
// if (elem.performanceScore === null || elem.performanceScore === '' || elem.performanceScore === undefined) { delete elem.color
// delete elem.performanceScore }
// } if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
// if (elem.productScore === null || elem.productScore === '' || elem.productScore === undefined) { delete elem.kpiGrade
// delete elem.productScore }
// } if (elem.point === null || elem.point === '' || elem.point === undefined) {
// if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) { delete elem.point
// delete elem.quantity }
// } if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
// if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) { delete elem.salePrice
// delete elem.salePrice }
// } if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
// if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) { delete elem.costPrice
// delete elem.costPrice }
// } if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
// if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) { delete elem.costMoney
// delete elem.costMoney }
// } if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
// if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) { delete elem.includeTaxMoney
// delete elem.includeTaxMoney }
// } if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
// if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { delete elem.taxRate
// delete elem.taxRate }
// } if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
// if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) { elem.taxRate = elem.taxRate / 100
// elem.taxRate = elem.taxRate / 100 }
// } if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
// if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) { delete elem.taxMoney
// delete elem.taxMoney }
// } if (elem.money === null || elem.money === '' || elem.money === undefined) {
// if (elem.money === null || elem.money === '' || elem.money === undefined) { delete elem.money
// delete elem.money }
// } if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
// if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) { delete elem.includeTaxCostMoney
// delete elem.includeTaxCostMoney }
// } if (elem.discount === null || elem.discount === '' || elem.discount === undefined) {
// if (elem.discount === null || elem.discount === '' || elem.discount === undefined) { delete elem.discount
// delete elem.discount }
// } if (elem.discount !== null || elem.discount !== '' || elem.discount !== undefined) {
// if (elem.discount !== null || elem.discount !== '' || elem.discount !== undefined) { elem.discount = elem.discount / 100
// elem.discount = elem.discount / 100 }
// } if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
// if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) { delete elem.discountMoney
// delete elem.discountMoney }
// } if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
// return elem delete elem.alreadyReturnQuantity
// }) }
// EnterDetail2.map(function(elem) { if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
// return elem delete elem.returnQuantity
// }).forEach(function(elem) { }
// if (elem.costName === null || elem.costName === '' || elem.costName === undefined) { if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) {
// delete elem.costName delete elem.returnReason
// } }
// if (elem.money === null || elem.money === '' || elem.money === undefined) { if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) {
// delete elem.money delete elem.sendQuantity
// } }
// if (elem.remark === null || elem.remark === '' || elem.remark === undefined) { if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
// delete elem.remark delete elem.carCode
// } }
// return elem if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
// }) delete elem.motorCode
// const parms2 = JSON.stringify(EnterDetail) }
// const parms3 = JSON.stringify(EnterDetail2) if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
// const Data = this.personalForm delete elem.batteryCode
// for (const key in Data) { }
// if (Data[key] === '' || Data[key] === undefined || Data[key] === null) { if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
// delete Data[key] delete elem.locationId
// } }
// } return elem
// const parms = JSON.stringify(Data) })
// this.$refs.personalForm.validate((valid) => { const parms2 = JSON.stringify(EnterDetail)
// if (valid) { const Data = this.personalForm
// createSaleReturn(parms, parms2, parms3, this.personalForm).then(res => { for (const key in Data) {
// console.log(res) if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
// if (res.data.ret === 200) { delete Data[key]
// this.$notify({ }
// title: '', }
// message: '', const parms = JSON.stringify(Data)
// type: 'success', this.$refs.personalForm.validate((valid) => {
// offset: 100 if (valid) {
// }) createsaleReturn(parms, parms2, this.personalForm).then(res => {
// this.restAllForm() console.log(res)
// this.$refs.editable.clear() if (res.data.ret === 200) {
// this.$refs.editable2.clear() this.$notify({
// this.$refs.personalForm.clearValidate() title: '成功',
// this.$refs.personalForm.resetFields() message: '保存成功',
// this.$refs.personalForm2.clearValidate() type: 'success',
// this.$refs.personalForm2.resetFields() offset: 100
// this.$refs.personalForm3.clearValidate() })
// this.$refs.personalForm3.resetFields() this.restAllForm()
// } else { this.$refs.editable.clear()
// this.$notify.error({ this.$refs.personalForm.clearValidate()
// title: '', this.$refs.personalForm.resetFields()
// message: res.data.msg, this.$refs.personalForm2.clearValidate()
// offset: 100 this.$refs.personalForm2.resetFields()
// }) this.$refs.personalForm3.clearValidate()
// } this.$refs.personalForm3.resetFields()
// }) } else {
// } else { this.$notify.error({
// this.$notify.error({ title: '错误',
// title: '', message: res.data.msg,
// message: '', offset: 100
// offset: 100 })
// }) }
// return false })
// } } else {
// }) this.$notify.error({
// }, title: '错误',
message: '信息未填完整',
offset: 100
})
return false
}
})
},
// //
handlecancel() { handlecancel() {
this.$router.go(-1) this.$router.go(-1)

View file

@ -0,0 +1,628 @@
<template>
<div class="ERP-container">
<el-card class="box-card" style="margin-top: 10px;height: 60px" shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" label-width="100px" style="margin-top: -9px">
<el-col :span="5">
<el-form-item label="订单主题" label-width="100px">
<el-input v-model="getemplist.title" :placeholder="$t('SaleReturn.title')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-left: 10px">
<el-form-item label="订单单号">
<el-input v-model="getemplist.number" placeholder="订单单号" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-left: 10px">
<el-form-item :label="$t('SaleReturn.payType')">
<el-select v-model="getemplist.payType" :value="getemplist.payType" clearable @keyup.enter.native="handleFilter">
<el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.customerType" :placeholder="$t('SaleReturn.customerType')" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
<el-input v-model="customerName" :placeholder="$t('SaleReturn.customerName')" style="width: 40%;float: right;margin-right: 20px;" clearable @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" placeholder="单据状态" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option value="1" label="制单"/>
<el-option value="2" label="执行"/>
<el-option value="3" label="结单"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" placeholder="审批状态" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option value="0" label="未审核"/>
<el-option value="1" label="审核中"/>
<el-option value="2" label="审核通过"/>
<el-option value="3" label="审核不通过"/>
</el-select>
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
unlink-panels
start-placeholder="销售日期"
end-placeholder="销售日期"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 10px" shadow="never">
<!-- 批量操作 -->
<el-dropdown @command="handleCommand">
<el-button v-waves class="filter-item" style="margin-left: 0" 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" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-card>
<el-card class="box-card" style="margin-top: 10px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="selectInit"
type="selection"
width="55"
align="center"/>
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.number }}</span>
</template>
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
</el-table-column>
<el-table-column :label="$t('SaleReturn.title')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.sourceNumber')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.sourceType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.customerName')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.customerPhone')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.receiveAddress')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiveAddress }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.salePersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.salePersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.returnDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.returnDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleReturn.allMoney')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.allMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptStat | receiptStatFilter }}</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 v-if="scope.row.judgeStat === 0" title="修改" type="primary" size="mini" icon="el-icon-edit" circle @click="handleEdit(scope.row)"/>
<el-button v-if="isReview(scope.row)" title="审批" type="warning" size="mini" icon="el-icon-view" circle @click="handleReview(scope.row)"/>
<el-button v-if="scope.row.judgeStat === 0" title="删除" size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
</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 :editcontrol.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist"/>
<!--修改结束=================================================-->
</el-card>
</div>
</template>
<script>
import { searchsaleReturn, deletesaleReturn, updatesaleReturn2 } from '@/api/SaleReturn'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyEmp from './components/MyEmp'
import DetailList from './components/DetailList'
import MyDialog from './components/MyDialog'
import MyCustomer from './components/MyCustomer'
import MyAgent from './components/MyAgent'
export default {
name: 'SaleReturnList',
directives: { waves },
components: { MyDialog, DetailList, MyEmp, MyCustomer, MyAgent, Pagination },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: '未审核',
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: '销售出库单',
2: '无来源'
}
return statusMap[status]
}
},
data() {
return {
//
customerName: '',
//
customercontrol: false,
agentcontrol: false,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
types: [],
//
depts: [],
//
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
},
//
detailvisible: false,
//
visible2: false,
//
supplierId: '',
//
empcontrol: false,
//
stockPersonId: '',
//
stockControl: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: 438,
regionIds: 2,
createPersonId: 3
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
mounted() {
this.getlist()
},
methods: {
//
selectInit(row, index) {
if (row.judgeStat !== 0) {
return false
} else {
return true
}
},
//
clearCustomer() {
this.getemplist.customerId = ''
this.customerName = ''
},
// focus
chooseCustomer() {
if (this.getemplist.customerType === '1') {
this.agentcontrol = true
} else if (this.getemplist.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.getemplist.customerId = val.id
this.customerName = val.customerName
},
agentdata(val) {
this.getemplist.customerId = val.id
this.customerName = val.agentName
},
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
searchsaleReturn(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
searchStockCategory(this.typeparms).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
//
restFilter() {
this.customerName = ''
this.getemplist.customerId = ''
this.stockPersonId = ''
this.getemplist.stockPersonId = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
searchsaleReturn(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.stockPersonId = val.personName
this.getemplist.stockPersonId = val.id
},
// focus
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierId = val.supplierName
this.getemplist.supplierId = val.id
},
//
handleEdit(row) {
console.log(row)
this.editVisible = true
this.personalForm = Object.assign({}, row)
this.personalForm.sourceType = String(row.sourceType)
if (row.currency !== null) {
this.personalForm.currency = String(row.currency)
}
if (row.customerType !== null) {
this.personalForm.customerType = String(row.customerType)
}
if (row.closeStatusId !== null) {
this.personalForm.closeStatusId = String(row.closeStatusId)
}
if (row.enterStatusId !== null) {
this.personalForm.enterStatusId = String(row.enterStatusId)
}
if (row.payType !== null) {
this.personalForm.payType = String(row.payType)
}
},
//
refreshlist(val) {
if (val === true) {
this.getlist()
}
},
//
handleDetail(row) {
console.log(row)
this.detailvisible = true
this.personalForm = Object.assign({}, row)
},
//
isReview(row) {
console.log(row)
if (row.approvalUseVos !== '' && row.approvalUseVos !== null && row.approvalUseVos !== undefined && row.approvalUseVos.length !== 0) {
const approvalUse = row.approvalUseVos
if (this.getemplist.createPersonId === approvalUse[approvalUse.length - 1].stepHandler && (row.judgeStat === 1 || row.judgeStat === 0)) {
return true
}
}
},
//
handleReview(row) {
this.reviewParms.id = row.id
this.reviewParms.judgePersonId = this.getemplist.createPersonId
this.$confirm('请审核', '审核', {
distinguishCancelAndClose: true,
confirmButtonText: '通过',
cancelButtonText: '不通过',
type: 'warning'
}).then(() => {
this.reviewParms.judgeStat = 2
const parms = JSON.stringify(this.reviewParms)
updatesaleReturn2(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: '审核成功!'
})
this.getlist()
}
})
}).catch(action => {
if (action === 'cancel') {
this.reviewParms.judgeStat = 1
const parms = JSON.stringify(this.reviewParms)
updatesaleReturn2(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: '审核成功!'
})
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(() => {
deletesaleReturn(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(() => {
deletesaleReturn(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: '已取消删除'
})
})
},
//
handleAdd() {
this.$router.push('/SaleReturn/AddSaleReturn')
},
//
handleExport() {
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
const filterVal = ['id', 'SaleReturnName', 'SaleReturnShortName', '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)
},
// focus
handlechooseRep() {
this.repositorycontrol = true
},
repositoryname(val) {
console.log(val)
this.enterRepositoryId = val.repositoryName
this.getemplist.enterRepositoryId = val.id
},
// focus
updatedept() {
this.getlist()
},
// foucs
handlechooseDelivery() {
this.deliverycontrol = true
},
deliveryName(val) {
this.deliveryPersonId = val.personName
this.getemplist.deliveryPersonId = val.id
},
// focus
handlechooseAccept() {
this.accetpcontrol = true
},
acceptName(val) {
this.acceptPersonId = val.personName
this.getemplist.acceptPersonId = val.id
}
}
}
</script>
<style rel="stylesheet/css" scoped>
.ERP-container >>> .el-form-item__label{
color: #909399;
text-align: left;
}
.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 10px;
}
.filter-container{
padding: 20px;
padding-left: 0px;
}
.filter-item{
width: 140px;
margin-left: 30px;
}
</style>

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.planNumber +' 详情'" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)"> <el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.number +' 详情'" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)">
<!--基本信息--> <!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never"> <el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2> <h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
@ -7,93 +7,77 @@
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.title')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<span>{{ personalForm.title }}</span> <span>{{ personalForm.title }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerType')" prop="customerType" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<span>{{ personalForm.customerType | customerTypeFliter }}</span> <span>{{ personalForm.sourceType | sourceTypeFilter }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<span>{{ personalForm.sourceNumber }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<span>{{ personalForm.customerType | customerTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<span>{{ personalForm.customerName }}</span> <span>{{ personalForm.customerName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerPhone')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<span>{{ personalForm.customerPhone }}</span> <span>{{ personalForm.customerPhone }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.invoiceType')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<span>{{ personalForm.invoiceType | invoiceTypeFilter }}</span> <span>{{ personalForm.closeTypeName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.payMode')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<span>{{ personalForm.payMode | payModeFilter }}</span> <span>{{ personalForm.payType | payTypeFilter }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.transDate')" prop="transDate" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<span>{{ personalForm.transDate }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.salePersonId')" prop="salePersonId" style="width: 100%;">
<span>{{ personalForm.salePersonName }}</span> <span>{{ personalForm.salePersonName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<span>{{ personalForm.saleRepositoryName }}</span> <span>{{ personalForm.saleRepositoryName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.roleId')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<span>{{ personalForm.roleName }}</span> <span>{{ personalForm.receiveAddress }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleType')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<span>{{ personalForm.saleTypeName }}</span> <span>{{ personalForm.returnDate }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.payType')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<span>{{ personalForm.payTypeName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.currency')" style="width: 100%;">
<span>{{ personalForm.currency | currencyFilter }}</span> <span>{{ personalForm.currency | currencyFilter }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.transAddress')" style="width: 100%;">
<span>{{ personalForm.transAddress }}</span>
<el-input v-model="personalForm.transAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.receiveMoney')" style="width: 100%;">
<span>{{ personalForm.receiveMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.colseType')" style="width: 100%;">
<span>{{ personalForm.colseTypeName }}</span>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
<!--子件信息--> <!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never"> <el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">订单明细</h2> <h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">退货明细</h2>
<div class="container"> <div class="container">
<el-editable <el-editable
ref="editable" ref="editable"
@ -106,15 +90,16 @@
style="width: 100%"> style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/> <el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/> <el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="locationId" align="center" label="货位" min-width="150px"/>
<el-editable-column prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/> <el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="Categoryid" align="center" label="物品分类" min-width="150px"/> <el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="typeId" align="center" label="规格型号" min-width="150px"/> <el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="performanceScore" align="center" label="绩效分" min-width="150px"/> <el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="productScore" align="center" label="商品积分" min-width="150px"/> <el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column prop="quantity" align="center" label="订单数量" min-width="150px"/>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/> <el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/> <el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/> <el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
@ -126,31 +111,90 @@
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/> <el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/> <el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column prop="returnQuantity" align="center" label="退货数量" min-width="150px"/>
<el-editable-column prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
<!--<el-card class="box-card" style="margin-top: 15px" shadow="never">--> <el-card class="box-card" shadow="never" style="margin-top: 10px">
<!--<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">销售费用明细</h2>--> <h2 ref="geren" class="form-name">合计信息</h2>
<!--<div class="container">--> <div class="container" style="margin-top: 37px">
<!--<el-editable--> <el-form ref="personalForm2" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<!--ref="editable2"--> <el-row>
<!--:data.sync="list3"--> <el-col :span="12">
<!--:edit-config="{ showIcon: true, showStatus: true}"--> <el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<!--:summary-method="getSummaries"--> <span>{{ personalForm.allQuantity }}</span>
<!--show-summary--> </el-form-item>
<!--class="click-table1"--> </el-col>
<!--stripe--> <el-col :span="12">
<!--border--> <el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<!--size="medium"--> <span>{{ personalForm.allMoney }}</span>
<!--style="width: 100%">--> </el-form-item>
<!--<el-editable-column type="selection" min-width="55" align="center"/>--> </el-col>
<!--<el-editable-column label="序号" width="60" align="center" type="index"/>--> <el-col :span="12">
<!--<el-editable-column prop="costName" align="center" label="费用名称" min-width="150px"/>--> <el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<!--<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>--> <span>{{ personalForm.allIncludeTaxMoney }}</span>
<!--<el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>--> </el-form-item>
<!--</el-editable>--> </el-col>
<!--</div>--> <el-col :span="12">
<!--</el-card>--> <el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<span>{{ personalForm.allTaxMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<span>{{ personalForm.allDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<span>{{ personalForm.allIncludeTaxDiscountMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<span>{{ personalForm.ridMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<span>{{ personalForm.actualReturnMoney }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">相关单据状态</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm3" :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<span>{{ personalForm.closeStatusId | closeStatusIdFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<span>{{ personalForm.alreadyMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<span>{{ personalForm.enterStatusId | enterStatusIdFilter }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--审核状态--> <!--审核状态-->
<el-card class="box-card" style="margin-top: 15px" shadow="never"> <el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name">审核状态</h2> <h2 ref="fuzhu" class="form-name">审核状态</h2>
@ -226,7 +270,6 @@
</template> </template>
<script> <script>
import { productlist } from '@/api/public'
export default { export default {
filters: { filters: {
currencyFilter(status) { currencyFilter(status) {
@ -237,27 +280,27 @@ export default {
return statusMap[status] return statusMap[status]
}, },
payTypeFilter(status) { payTypeFilter(status) {
const statusMap = {
1: '方式1',
2: '方式2'
}
return statusMap[status]
},
payModeFilter(status) {
const statusMap = { const statusMap = {
1: '货到付款', 1: '货到付款',
2: '当场支付' 2: '当场支付'
} }
return statusMap[status] return statusMap[status]
}, },
invoiceTypeFilter(status) { closeStatusIdFilter(status) {
const statusMap = { const statusMap = {
1: '', 1: '已结算',
2: '增值税' 2: '未结算'
} }
return statusMap[status] return statusMap[status]
}, },
customerTypeFliter(status) { enterStatusIdFilter(status) {
const statusMap = {
1: '已入库',
2: '未入库'
}
return statusMap[status]
},
customerTypeFilter(status) {
const statusMap = { const statusMap = {
1: '经销商', 1: '经销商',
2: '零售商' 2: '零售商'
@ -274,9 +317,8 @@ export default {
}, },
sourceTypeFilter(status) { sourceTypeFilter(status) {
const statusMap = { const statusMap = {
1: '采购申请', 1: '销售出库单',
2: '采购需求', 2: '无来源'
3: '无来源'
} }
return statusMap[status] return statusMap[status]
}, },
@ -321,63 +363,11 @@ export default {
}, },
detaildata() { detaildata() {
this.personalForm = this.detaildata this.personalForm = this.detaildata
this.list2 = this.personalForm.stockPlanDetailVos this.list2 = this.personalForm.saleReturnDetailVos
this.list3 = this.personalForm.stockPlanDetailVos
this.reviewList = this.personalForm.approvalUseVos this.reviewList = this.personalForm.approvalUseVos
} }
}, },
methods: { methods: {
//
planMoney(row) {
row.planMoney = row.basicPrice * row.planQuantity
return row.planMoney
},
//
basicPrice(row) {
productlist(row.productCode).then(res => {
if (res.data.ret === 200) {
row.basicPrice = res.data.data.content.list[0].purchasePrice
}
})
return row.basicPrice
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else {
sums[index] = ''
}
})
this.heji1 = sums[8]
this.heji2 = sums[7]
sums[1] = ''
sums[2] = ''
sums[3] = ''
sums[4] = ''
sums[6] = ''
sums[9] = ''
sums[10] = ''
sums[11] = ''
sums[12] = ''
return sums
},
handlecancel() { handlecancel() {
this.editVisible = false this.editVisible = false
} }

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.planNumber +' 修改'" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)"> <el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.number +' 修改'" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
<!--基本信息--> <!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never"> <el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2> <h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">基本信息</h2>
@ -7,12 +7,25 @@
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.title')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.title')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/> <el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerType')" prop="customerType" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseSource">
<el-option value="1" label="销售出库单"/>
<el-option value="2" label="无来源"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer"> <el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
<el-option value="1" label="经销商"/> <el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/> <el-option value="2" label="零售"/>
@ -20,116 +33,78 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/> <el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/> <my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/> <my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerPhone')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.customerPhone')" style="width: 100%;">
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px;width: 200px" clearable/> <el-input v-model="personalForm.customerPhone" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.invoiceType')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.closeType')" style="width: 100%;">
<el-select v-model="personalForm.invoiceType" style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.closeType" style="margin-left: 18px;width: 200px">
<el-option <el-option
v-for="(item, index) in invoiceTypes" v-for="(item, index) in colseTypes"
:value="item.id" :value="item.id"
:key="index" :key="index"
:label="item.categoryName" :label="item.categoryName"/>
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.payMode')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.payType')" style="width: 100%;">
<el-select v-model="personalForm.payMode" style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.payType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="货到付款"/> <el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/> <el-option value="2" label="当场支付"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.transDate')" prop="transDate" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.salePersonId')" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.saleRepositoryId')" style="width: 100%;">
<el-input v-model="saleRepositoryId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.receiveAddress')" style="width: 100%;">
<el-input v-model="personalForm.receiveAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.returnDate')" prop="returnDate" style="width: 100%;">
<el-date-picker <el-date-picker
v-model="personalForm.transDate" v-model="personalForm.returnDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/> style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.salePersonId')" prop="salePersonId" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="width: 100%;">
<el-input v-model="personalForm.saleRepositoryId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.roleId')" style="width: 100%;">
<el-input v-model="personalForm.roleId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleType')" style="width: 100%;">
<el-select v-model="personalForm.saleType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="类别1"/>
<el-option value="2" label="类别2"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.payType')" style="width: 100%;">
<el-select v-model="personalForm.payType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="方式1"/>
<el-option value="2" label="方式2"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.currency')" style="width: 100%;">
<el-select v-model="personalForm.currency" style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.currency" style="margin-left: 18px;width: 200px">
<el-option value="1" label="RMB"/> <el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/> <el-option value="2" label="USD"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.transAddress')" style="width: 100%;">
<el-input v-model="personalForm.transAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.receiveMoney')" style="width: 100%;">
<el-input v-model="personalForm.receiveMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.colseType')" style="width: 100%;">
<el-select v-model="personalForm.colseType" style="margin-left: 18px;width: 200px">
<el-option
v-for="(item, index) in colseTypes"
:value="item.id"
:key="index"
:label="item.categoryName"/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
<!--子件信息--> <!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never"> <el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >订单明细</h2> <h2 ref="fuzhu" class="form-name" >退货明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;"> <div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="handleAddproduct">添加商品</el-button> <el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
@ -148,141 +123,98 @@
style="width: 100%"> style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/> <el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column label="序号" min-width="55" align="center" type="index"/> <el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column :edit-render="{type: 'visible'}" prop="locationId" align="center" label="货位" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" placeholder="请选择货位" filterable clearable style="width: 100%;" @visible-change="updatebatch($event,scope)">
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="batch" align="center" label="批次" min-width="150px"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/> <el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="Categoryid" align="center" label="物品分类" min-width="150px"/> <el-editable-column prop="productCategoryName" align="center" label="物品分类" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="基本单位" min-width="150px"/>
<el-editable-column prop="typeId" align="center" label="规格型号" min-width="150px"/> <el-editable-column prop="productTypeName" align="center" label="规格型号" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="performanceScore" align="center" label="绩效分" min-width="150px"/> <el-editable-column prop="kpiGrade" align="center" label="绩效分" min-width="150px"/>
<el-editable-column prop="productScore" align="center" label="商品积分" min-width="150px"/> <el-editable-column prop="point" align="center" label="商品积分" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="quantity" align="center" label="订单数量" min-width="150px"> <el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="150px"/>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column prop="discount" align="center" label="折扣率" min-width="150px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="150px"/>
<el-editable-column prop="alreadyReturnQuantity" align="center" label="已退货数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="returnQuantity" align="center" label="退货数量" min-width="150px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:controls="false" :controls="false"
v-model="scope.row.quantity" v-model="scope.row.returnQuantity"
@change="getquantity(scope.row)"/> @change="getquantity(scope.row)"/>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="salePrice" align="center" label="零售价" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInput', attrs: {min: 0}, type: 'visible'}" prop="returnReason" align="center" label="退货原因" min-width="150px"/>
<el-editable-column prop="costPrice" align="center" label="成本价" min-width="150px"/> <el-editable-column prop="sendQuantity" align="center" label="发货数量" min-width="150px"/>
<el-editable-column prop="taxprice" align="center" label="含税价" min-width="150px"> <el-editable-column prop="carCode" align="center" label="车架号" min-width="150px"/>
<template slot-scope="scope"> <el-editable-column prop="motorCode" align="center" label="电机编码" min-width="150px"/>
<span>{{ gettaxprice(scope.row) }}</span> <el-editable-column prop="batteryCode" align="center" label="电池编码" min-width="150px"/>
</template> <el-editable-column prop="includeTaxCostMoney" align="center" label="源单编号" min-width="150px"/>
</el-editable-column>
<el-editable-column prop="costMoney" align="center" label="成本金额" min-width="150px"/>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.taxRate"
@change="gettaxRate(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.taxMoney"
@change="gettaxMoney(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<el-editable-column prop="includeTaxCostMoney" align="center" label="含税成本金额" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discount" align="center" label="折扣率" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.discount"
@change="getdiscount(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountMoney" align="center" label="折扣额" min-width="150px">
<template slot="edit" slot-scope="scope">
<el-input-number
:controls="false"
v-model="scope.row.discountMoney"
@change="getdiscountMoney(scope.row)"/>
</template>
</el-editable-column>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
<!--<el-card class="box-card" style="margin-top: 15px" shadow="never">-->
<!--<h2 ref="fuzhu" class="form-name" >销售费用明细</h2>-->
<!--<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">-->
<!--<el-button @click="$refs.editable2.insert(-1)">添加</el-button>-->
<!--<el-button type="danger" @click="$refs.editable2.removeSelecteds()">删除</el-button>-->
<!--</div>-->
<!--<div class="container">-->
<!--<el-editable-->
<!--ref="editable2"-->
<!--:data.sync="list3"-->
<!--:edit-config="{ showIcon: true, showStatus: true}"-->
<!--:edit-rules="validRules"-->
<!--class="click-table1"-->
<!--stripe-->
<!--border-->
<!--size="medium"-->
<!--style="width: 100%">-->
<!--<el-editable-column type="selection" min-width="55" align="center"/>-->
<!--<el-editable-column label="序号" width="60" align="center" type="index"/>-->
<!--<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="costName" align="center" label="费用名称" min-width="150px"/>-->
<!--<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="money" align="center" label="金额" min-width="150px"/>-->
<!--<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="remark" align="center" label="备注" min-width="150px"/>-->
<!--</el-editable>-->
<!--</div>-->
<!--</el-card>-->
<el-card class="box-card" shadow="never" style="margin-top: 10px"> <el-card class="box-card" shadow="never" style="margin-top: 10px">
<h2 ref="geren" class="form-name">合计信息</h2> <h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px"> <div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji1')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji1')" style="width: 100%;">
<el-input v-model="personalForm.allQuantity" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji1" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji2')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji2')" style="width: 100%;">
<el-input v-model="personalForm.allMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji2" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji3')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji3')" style="width: 100%;">
<el-input v-model="personalForm.allIncludeTaxMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji3" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji4')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji4')" style="width: 100%;">
<el-input v-model="personalForm.allTaxMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji4" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji5')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji5')" style="width: 100%;">
<el-input v-model="personalForm.allDiscountMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji5" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji6')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.heji6')" style="width: 100%;">
<el-input v-model="personalForm.allIncludeTaxDiscountMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="heji6" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji7')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.ridMoney')" style="width: 100%;">
<el-input v-model="personalForm.allIncludeTaxCostMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.ridMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji8')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.actualReturnMoney')" style="width: 100%;">
<el-input v-model="personalForm.allCostMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.actualReturnMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.heji9')" style="width: 100%;">
<el-input v-model="personalForm.allSaletMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -295,23 +227,23 @@
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.backType')" prop="backType" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.closeStatusId')" prop="closeStatusId" style="width: 100%;">
<el-select v-model="personalForm.backType" style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.closeStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label=""/> <el-option value="1" label="已结算"/>
<el-option value="2" label=""/> <el-option value="2" label="未结算"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.backMoney')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.alreadyMoney')" style="width: 100%;">
<el-input v-model="personalForm.backMoney" style="margin-left: 18px;width: 200px"/> <el-input v-model="personalForm.alreadyMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('SaleOrder.sendType')" style="width: 100%;"> <el-form-item :label="$t('SaleReturn.enterStatusId')" style="width: 100%;">
<el-select v-model="personalForm.sendType" style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.enterStatusId" style="margin-left: 18px;width: 200px">
<el-option value="1" label="已发货"/> <el-option value="1" label="已入库"/>
<el-option value="2" label="未发货"/> <el-option value="2" label="未入库"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -329,18 +261,18 @@
</template> </template>
<script> <script>
import { updatesaleOrder } from '@/api/SaleOrder' import { updatesaleReturn } from '@/api/SaleReturn'
import { searchSaleCategory } from '@/api/SaleCategory' import { searchSaleCategory } from '@/api/SaleCategory'
import { getlocation, locationlist } from '@/api/public'
import MyEmp from './MyEmp' import MyEmp from './MyEmp'
import MyDelivery from '../../DailyAdjust/components/MyDelivery' import MyDelivery from './MyDelivery'
import MyDetail from './MyDetail' import MyDetail from './MyDetail'
import MyApply from './MyApply' import MyApply from './MyApply'
import MySupplier from '../../Product/components/MySupplier'
import MyRequire from './MyRequire' import MyRequire from './MyRequire'
import MyCustomer from './MyCustomer' import MyCustomer from './MyCustomer'
import MyAgent from './MyAgent' import MyAgent from './MyAgent'
export default { export default {
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp }, components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
props: { props: {
editcontrol: { editcontrol: {
type: Boolean, type: Boolean,
@ -377,6 +309,14 @@ export default {
heji7: '', heji7: '',
heji8: '', heji8: '',
heji9: '', heji9: '',
//
locationlist: [],
//
IsNumber: true,
//
Isproduct: true,
//
saleRepositoryId: '',
// //
customerId: '', customerId: '',
// //
@ -386,21 +326,14 @@ export default {
salePersonId: '', salePersonId: '',
// //
stockControl: false, stockControl: false,
//
invoiceTypes: [],
//
invoicetypeparms: {
type: 4,
pagenum: 1,
pagesize: 99999
},
// //
colseTypes: [], colseTypes: [],
// //
colseTypeparms: { colseTypeparms: {
type: 3, type: 3,
pagenum: 1, pagenum: 1,
pagesize: 99999 pagesize: 99999,
iseffective: 1
}, },
// //
control: false, control: false,
@ -412,14 +345,17 @@ export default {
customerName: [ customerName: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'focus' }
], ],
transDate: [ returnDate: [
{ required: true, message: '请选择货日期', trigger: 'change' } { required: true, message: '请选择退货日期', trigger: 'change' }
], ],
salePersonId: [ currency: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, message: '请选择币种', trigger: 'change' }
], ],
backType: [ sourceType: [
{ required: true, message: '请选择回款状态', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
],
closeStatusId: [
{ required: true, message: '请选择结算状态', trigger: 'change' }
] ]
}, },
// //
@ -437,17 +373,61 @@ export default {
}, },
editdata() { editdata() {
this.personalForm = this.editdata this.personalForm = this.editdata
this.planPersonId = this.personalForm.planPersonName this.salePersonId = this.personalForm.salePersonName
this.stockPersonId = this.personalForm.stockPersonName this.customerId = this.personalForm.customerName
this.list2 = this.personalForm.saleOrderDetailVos this.saleRepositoryId = this.personalForm.saleRepositoryName
this.list3 = this.personalForm.saleOrderCostDetails this.personalForm.customerPhone = this.personalForm.phoneNumber
this.chooseType() this.list2 = this.personalForm.saleReturnDetailVos
this.chooseSource()
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
}, },
methods: { methods: {
updatebatch(event, scope) {
if (event === true) {
if (this.personalForm.saleRepositoryId === undefined || this.personalForm.saleRepositoryId === '') {
this.$notify.error({
title: '错误',
message: '请先选择仓库',
offset: 100
})
return false
}
getlocation(this.personalForm.saleRepositoryId, scope.row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.saleRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
}
},
getTypes() {
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
//
chooseSource(val) {
if (val === '1') {
this.Isproduct = true
this.IsNumber = false
} else if (val === '2') {
this.Isproduct = false
this.IsNumber = true
}
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -473,17 +453,24 @@ export default {
} }
}) })
sums[2] = '' sums[2] = ''
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = '' sums[6] = ''
sums[7] = ''
sums[8] = '' sums[8] = ''
sums[9] = '' sums[9] = ''
this.heji1 = sums[10] sums[25] = ''
this.heji2 = sums[18] sums[27] = ''
this.heji3 = sums[15] sums[28] = ''
this.heji4 = sums[17] sums[29] = ''
this.heji5 = sums[21] sums[30] = ''
this.heji6 = sums[15] - sums[21] this.heji1 = sums[24]
this.heji7 = sums[19] this.heji2 = sums[19]
this.heji8 = sums[14] this.heji3 = sums[16]
this.heji4 = sums[18]
this.heji5 = sums[22]
this.heji6 = sums[20] - sums[22]
return sums return sums
}, },
// //
@ -494,19 +481,19 @@ export default {
getdiscount(row) { getdiscount(row) {
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2) row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2)
}, },
//
getquantity(row) { getquantity(row) {
row.costMoney = row.quantity * row.costPrice row.costMoney = row.returnQuantity * row.costPrice
row.includeTaxMoney = row.quantity * row.taxprice row.taxprice = row.salePrice * (1 + row.taxRate / 100)
row.money = row.quantity * row.salePrice row.includeTaxMoney = row.returnQuantity * row.taxprice
row.money = row.returnQuantity * row.salePrice
row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney row.includeTaxCostMoney = row.includeTaxMoney + row.costMoney
row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.quantity).toFixed(2) row.taxMoney = ((row.taxRate / 100) * row.salePrice * row.returnQuantity).toFixed(2)
if (row.quantity !== 0) { if (row.returnQuantity !== 0) {
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2) row.taxRate = ((row.taxMoney / (row.salePrice * row.returnQuantity)) * 100).toFixed(2)
row.discount = (1 - row.discountMoney / row.salePrice / row.quantity).toFixed(2) row.discount = (1 - row.discountMoney / row.salePrice / row.returnQuantity).toFixed(2)
} }
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount)).toFixed(2) row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
return row.quantity return row.returnQuantity
}, },
// //
gettaxprice(row) { gettaxprice(row) {
@ -577,20 +564,6 @@ export default {
updatecountry() { updatecountry() {
this.getTypes() this.getTypes()
}, },
getTypes() {
//
searchSaleCategory(this.invoicetypeparms).then(res => {
if (res.data.ret === 200) {
this.invoiceTypes = res.data.data.content.list
}
})
//
searchSaleCategory(this.colseTypeparms).then(res => {
if (res.data.ret === 200) {
this.colseTypes = res.data.data.content.list
}
})
},
// focus // focus
handlechooseStock() { handlechooseStock() {
this.stockControl = true this.stockControl = true
@ -599,6 +572,10 @@ export default {
stockName(val) { stockName(val) {
this.salePersonId = val.personName this.salePersonId = val.personName
this.personalForm.salePersonId = val.id this.personalForm.salePersonId = val.id
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.repositoryId
this.roleId = val.postName
this.personalForm.roleId = val.postId
}, },
// //
restAllForm() { restAllForm() {
@ -620,7 +597,6 @@ export default {
this.personalForm.countryId = 1 this.personalForm.countryId = 1
this.personalForm.modifyPersonId = 3 this.personalForm.modifyPersonId = 3
const EnterDetail = this.$refs.editable.getRecords() const EnterDetail = this.$refs.editable.getRecords()
const EnterDetail2 = this.$refs.editable2.getRecords()
if (EnterDetail.length === 0) { if (EnterDetail.length === 0) {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
@ -632,29 +608,29 @@ export default {
EnterDetail.map(function(elem) { EnterDetail.map(function(elem) {
return elem return elem
}).forEach(function(elem) { }).forEach(function(elem) {
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) { if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.productCode delete elem.batch
} }
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) { if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName delete elem.productName
} }
if (elem.typeId === null || elem.typeId === '' || elem.typeId === undefined) { if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.typeId delete elem.category
} }
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) { if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit delete elem.unit
} }
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.color === null || elem.color === '' || elem.color === undefined) { if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color delete elem.color
} }
if (elem.performanceScore === null || elem.performanceScore === '' || elem.performanceScore === undefined) { if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.performanceScore delete elem.kpiGrade
} }
if (elem.productScore === null || elem.productScore === '' || elem.productScore === undefined) { if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.productScore delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
} }
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) { if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice delete elem.salePrice
@ -692,24 +668,33 @@ export default {
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) { if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney delete elem.discountMoney
} }
return elem if (elem.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
}) delete elem.alreadyReturnQuantity
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.costName === null || elem.costName === '' || elem.costName === undefined) {
delete elem.costName
} }
if (elem.money === null || elem.money === '' || elem.money === undefined) { if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
delete elem.money delete elem.returnQuantity
} }
if (elem.remark === null || elem.remark === '' || elem.remark === undefined) { if (elem.returnReason === null || elem.returnReason === '' || elem.returnReason === undefined) {
delete elem.remark delete elem.returnReason
}
if (elem.sendQuantity === null || elem.sendQuantity === '' || elem.sendQuantity === undefined) {
delete elem.sendQuantity
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
delete elem.locationId
} }
return elem return elem
}) })
const parms2 = JSON.stringify(EnterDetail) const parms2 = JSON.stringify(EnterDetail)
const parms3 = JSON.stringify(EnterDetail2)
const Data = this.personalForm const Data = this.personalForm
for (const key in Data) { for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) { if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
@ -717,7 +702,7 @@ export default {
} }
} }
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
updatesaleOrder(parms, parms2, parms3).then(res => { updatesaleReturn(parms, parms2).then(res => {
if (res.data.ret === 200) { if (res.data.ret === 200) {
this.$notify({ this.$notify({
title: '操作成功', title: '操作成功',
@ -728,7 +713,6 @@ export default {
}) })
this.$emit('rest', true) this.$emit('rest', true)
this.$refs.editable.clear() this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate() this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields() this.$refs.personalForm.resetFields()
this.editVisible = false this.editVisible = false
@ -743,7 +727,6 @@ export default {
}, },
handlecancel() { handlecancel() {
this.$refs.editable.clear() this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate() this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields() this.$refs.personalForm.resetFields()
this.editVisible = false this.editVisible = false

View file

@ -24,14 +24,14 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockApply.applyPersonId')" style="width: 100%;"> <el-form-item :label="$t('StockApply.applyPersonId')" prop="applyPersonId" style="width: 100%;">
<el-input v-model="applyPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="applyPersonId" style="margin-left: 18px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockApply.applyDeptId')" prop="applyDeptId" style="width: 100%;"> <el-form-item :label="$t('StockApply.applyDeptId')" prop="applyDeptId" style="width: 100%;">
<el-select v-model="personalForm.applyDeptId" clearable style="margin-left: 18px"> <el-select v-model="personalForm.applyDeptId" style="margin-left: 18px" @change="change()">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -44,6 +44,7 @@
<el-form-item :label="$t('StockApply.sourceType')" prop="sourceType" style="width: 100%;"> <el-form-item :label="$t('StockApply.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px">
<el-option value="1" label="无来源" /> <el-option value="1" label="无来源" />
<el-option value="2" label="销售订单" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -52,6 +53,7 @@
<el-date-picker <el-date-picker
v-model="personalForm.applyDate" v-model="personalForm.applyDate"
type="date" type="date"
default-value
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="margin-left: 18px"/> style="margin-left: 18px"/>
</el-form-item> </el-form-item>
@ -87,9 +89,10 @@
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="requireQuantity" align="center" label="需求数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible', events: {change: changeDate}}" prop="requireQuantity" align="center" label="需求数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="requireDate" align="center" label="需求日期" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible', events: {change: changeDate}}" prop="requireDate" align="center" label="需求日期" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="applyReason" align="center" label="申请原因" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="applyReason" align="center" label="申请原因" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -112,8 +115,18 @@
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="applyQuantity" align="center" label="申请数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd', disable: 'true'},}" prop="requireDate" align="center" label="需求日期" min-width="150px">
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="planQuantity" align="center" label="已计划数量" min-width="150px"/> <template slot="edit" slot-scope="scope">
<el-date-picker
v-model="scope.row.requireDate"
disabled
type="date"
value-format="yyyy-MM-dd"/>
</template>
</el-editable-column>
<el-editable-column prop="applyQuantity" align="center" label="申请数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {precision: 2}}" prop="planQuantity" align="center" label="已计划数量" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -136,6 +149,14 @@ export default {
name: 'AddStockApply', name: 'AddStockApply',
components: { MyDetail, MyEmp }, components: { MyDetail, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => {
console.log(this.applyPersonId)
if (this.applyPersonId === undefined || this.applyPersonId === null || this.applyPersonId === '') {
callback(new Error('请选择申请人'))
} else {
callback()
}
}
return { return {
// //
choosedata: [], choosedata: [],
@ -164,6 +185,9 @@ export default {
}, },
// //
personalrules: { personalrules: {
applyPersonId: [
{ required: true, validator: validatePass, trigger: 'change' }
],
stockType: [ stockType: [
{ required: true, message: '请选择采购类别', trigger: 'change' } { required: true, message: '请选择采购类别', trigger: 'change' }
], ],
@ -171,7 +195,7 @@ export default {
{ required: true, message: '请选择申请日期', trigger: 'change' } { required: true, message: '请选择申请日期', trigger: 'change' }
], ],
applyDeptId: [ applyDeptId: [
{ required: true, message: '请选择申请部门', trigger: 'change' } { required: true, message: '请选择申请部门', trigger: 'none' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
@ -183,13 +207,33 @@ export default {
list3: [], list3: [],
// //
validRules: { validRules: {
requireQuantity: [
{ required: true, message: '请输入需求数量', trigger: 'change' }
],
requireDate: [
{ required: true, message: '请选择需求日期', trigger: 'change' }
]
} }
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
this.getdatatime()
}, },
methods: { methods: {
//
changeDate(scope, value) {
console.log(scope)
scope.row.applyQuantity = (scope.row.requireQuantity).toFixed(2)
this.$refs.editable2.clear()
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < nowlistdata.length; i++) {
this.$refs.editable2.insert(nowlistdata[i])
}
},
getdatatime() { //
this.personalForm.applyDate = new Date()
},
// //
deleteEdit() { deleteEdit() {
this.$refs.editable.removeSelecteds() this.$refs.editable.removeSelecteds()
@ -207,6 +251,10 @@ export default {
deleteChange(val) { deleteChange(val) {
this.choosedata = val this.choosedata = val
}, },
//
change() {
this.$forceUpdate()
},
// //
updatecountry() { updatecountry() {
this.getTypes() this.getTypes()
@ -231,8 +279,10 @@ export default {
}, },
// //
stockName(val) { stockName(val) {
console.log(val)
this.applyPersonId = val.personName this.applyPersonId = val.personName
this.personalForm.applyPersonId = val.id this.personalForm.applyPersonId = val.id
this.personalForm.applyDeptId = val.deptId
}, },
// //
handleAddproduct() { handleAddproduct() {
@ -349,27 +399,31 @@ export default {
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
addstockapply(parms, parms2, this.personalForm).then(res => { this.$refs.editable.validate().then(valid => {
console.log(res) addstockapply(parms, parms2, this.personalForm).then(res => {
if (res.data.ret === 200) { console.log(res)
this.$notify({ if (res.data.ret === 200) {
title: '成功', this.$notify({
message: '保存成功', title: '成功',
type: 'success', message: '保存成功',
offset: 100 type: 'success',
}) offset: 100
this.restAllForm() })
this.$refs.editable.clear() this.restAllForm()
this.$refs.editable2.clear() this.$refs.editable.clear()
this.$refs.personalForm.clearValidate() this.$refs.editable2.clear()
this.$refs.personalForm.resetFields() this.$refs.personalForm.clearValidate()
} else { this.$refs.personalForm.resetFields()
this.$notify.error({ } else {
title: '错误', this.$notify.error({
message: res.data.msg, title: '错误',
offset: 100 message: res.data.msg,
}) offset: 100
} })
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
} else { } else {
this.$notify.error({ this.$notify.error({

View file

@ -264,10 +264,11 @@ export default {
productCode: item.code, productCode: item.code,
productName: item.productName, productName: item.productName,
typeId: item.typeId, typeId: item.typeId,
requireQuantity: 0, requireQuantity: 1.00,
color: item.color, color: item.color,
unit: item.purMeasu, unit: item.purMeasu,
productType: item.productType productType: item.productType,
planQuantity: '0.00'
} }
}) })
const productDetail2 = this.moreaction.map(function(item) { const productDetail2 = this.moreaction.map(function(item) {
@ -278,7 +279,7 @@ export default {
color: item.color, color: item.color,
unit: item.purMeasu, unit: item.purMeasu,
productType: item.productType, productType: item.productType,
applyQuantity: 0, applyQuantity: '0.00',
planQuantity: 0 planQuantity: 0
} }
}) })

View file

@ -23,14 +23,14 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockApply.applyPersonId')" style="width: 100%;"> <el-form-item :label="$t('StockApply.applyPersonId')" prop="applyPersonId" style="width: 100%;">
<el-input v-model="applyPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="applyPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockApply.applyDeptId')" prop="applyDeptId" style="width: 100%;"> <el-form-item :label="$t('StockApply.applyDeptId')" prop="applyDeptId" style="width: 100%;">
<el-select v-model="personalForm.applyDeptId" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.applyDeptId" clearable style="margin-left: 18px;width: 218px" @change="change()">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -43,6 +43,7 @@
<el-form-item :label="$t('StockApply.sourceType')" prop="sourceType" style="width: 100%;"> <el-form-item :label="$t('StockApply.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px">
<el-option value="1" label="无来源" /> <el-option value="1" label="无来源" />
<el-option value="2" label="销售订单" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -86,13 +87,14 @@
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="requireQuantity" align="center" label="需求数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible', events: {change: changeDate}}" prop="requireQuantity" align="center" label="需求数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="requireDate" align="center" label="需求日期" min-width="180px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible', events: {change: changeDate}}" prop="requireDate" align="center" label="需求日期" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="applyReason" align="center" label="申请原因" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="applyReason" align="center" label="申请原因" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never"> <el-card class="box-card" style="margin-top: 15px;margin-bottom: 30px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购申请明细</h2> <h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购申请明细</h2>
<div class="container"> <div class="container">
<el-editable <el-editable
@ -111,8 +113,18 @@
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="applyQuantity" align="center" label="申请数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd', disable: 'true'},}" prop="requireDate" align="center" label="需求日期" min-width="150px">
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="planQuantity" align="center" label="已计划数量" min-width="150px"/> <template slot="edit" slot-scope="scope">
<el-date-picker
v-model="scope.row.requireDate"
disabled
type="date"
value-format="yyyy-MM-dd"/>
</template>
</el-editable-column>
<el-editable-column prop="applyQuantity" align="center" label="申请数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {precision: 2}}" prop="planQuantity" align="center" label="已计划数量" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -144,6 +156,14 @@ export default {
} }
}, },
data() { data() {
const validatePass = (rule, value, callback) => {
console.log(this.applyPersonId)
if (this.applyPersonId === undefined || this.applyPersonId === null || this.applyPersonId === '') {
callback(new Error('请选择申请人'))
} else {
callback()
}
}
return { return {
// //
choosedata: [], choosedata: [],
@ -168,6 +188,9 @@ export default {
control: false, control: false,
// //
personalrules: { personalrules: {
applyPersonId: [
{ required: true, validator: validatePass, trigger: 'change' }
],
stockType: [ stockType: [
{ required: true, message: '请选择采购类别', trigger: 'change' } { required: true, message: '请选择采购类别', trigger: 'change' }
], ],
@ -175,7 +198,7 @@ export default {
{ required: true, message: '请选择申请日期', trigger: 'change' } { required: true, message: '请选择申请日期', trigger: 'change' }
], ],
applyDeptId: [ applyDeptId: [
{ required: true, message: '请选择申请部门', trigger: 'change' } { required: true, message: '请选择申请部门', trigger: 'none' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
@ -187,6 +210,12 @@ export default {
list3: [], list3: [],
// //
validRules: { validRules: {
requireQuantity: [
{ required: true, message: '请输入需求数量', trigger: 'change' }
],
requireDate: [
{ required: true, message: '请选择需求日期', trigger: 'change' }
]
} }
} }
}, },
@ -199,12 +228,26 @@ export default {
this.applyPersonId = this.personalForm.applyPersonName this.applyPersonId = this.personalForm.applyPersonName
this.list2 = this.personalForm.stockApplyDetailVos this.list2 = this.personalForm.stockApplyDetailVos
this.list3 = this.personalForm.stockApplyDetailVos this.list3 = this.personalForm.stockApplyDetailVos
this.getdatatime()
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
}, },
methods: { methods: {
//
changeDate(scope, value) {
console.log(scope)
scope.row.applyQuantity = (scope.row.requireQuantity).toFixed(2)
this.$refs.editable2.clear()
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < nowlistdata.length; i++) {
this.$refs.editable2.insert(nowlistdata[i])
}
},
getdatatime() { //
this.personalForm.applyDate = new Date()
},
// //
deleteEdit() { deleteEdit() {
this.$refs.editable.removeSelecteds() this.$refs.editable.removeSelecteds()
@ -222,6 +265,10 @@ export default {
deleteChange(val) { deleteChange(val) {
this.choosedata = val this.choosedata = val
}, },
//
change() {
this.$forceUpdate()
},
// //
updatecountry() { updatecountry() {
this.getTypes() this.getTypes()
@ -248,6 +295,7 @@ export default {
stockName(val) { stockName(val) {
this.applyPersonId = val.personName this.applyPersonId = val.personName
this.personalForm.applyPersonId = val.id this.personalForm.applyPersonId = val.id
this.personalForm.applyDeptId = val.deptId
}, },
// //
handleAddproduct() { handleAddproduct() {
@ -368,27 +416,42 @@ export default {
} }
} }
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
updatestockapply(parms, parms2).then(res => { this.$refs.personalForm.validate((valid) => {
if (res.data.ret === 200) { if (valid) {
this.$notify({ this.$refs.editable.validate().then(valid => {
title: '操作成功', updatestockapply(parms, parms2).then(res => {
message: '操作成功', if (res.data.ret === 200) {
type: 'success', this.$notify({
duration: 1000, title: '操作成功',
offset: 100 message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else { } else {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
message: '出错了', message: '信息未填完整',
offset: 100 offset: 100
}) })
return false
} }
}) })
}, },
@ -416,6 +479,7 @@ export default {
} }
.edit >>> .el-dialog { .edit >>> .el-dialog {
background:#f1f1f1 ; background:#f1f1f1 ;
height: auto;
} }
.el-col-12{ .el-col-12{
width: 49%; width: 49%;

View file

@ -124,7 +124,7 @@
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" @product="productdetail"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-order :ordercontrol="ordercontrol" @order="order" @allOrderinfo="allOrderinfo"/> <my-order :ordercontrol.sync="ordercontrol" @order="order" @allOrderinfo="allOrderinfo"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
<div class="container"> <div class="container">
@ -152,11 +152,27 @@
<el-editable-column prop="price" align="center" label="单价" min-width="170px"/> <el-editable-column prop="price" align="center" label="单价" min-width="170px"/>
<el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/> <el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/> <el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/> <el-editable-column prop="money" align="center" label="金额" min-width="150px">
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/> <template slot-scope="scope">
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/> <p>{{ getMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/> <el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot-scope="scope">
<p>{{ getdiscountMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="remark" align="center" label="备注" min-width="150px"/> <el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
@ -206,7 +222,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="其他费用支出合计" style="width: 100%;"> <el-form-item label="其他费用支出合计" style="width: 100%;">
<el-input v-model="allOthermoney" style="margin-left: 18px"/> <el-input v-model="allOthermoney" style="margin-left: 18px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -363,6 +379,8 @@ export default {
sums[4] = '' sums[4] = ''
sums[5] = '' sums[5] = ''
sums[6] = '' sums[6] = ''
sums[8] = ''
sums[9] = ''
sums[10] = '' sums[10] = ''
sums[15] = '' sums[15] = ''
sums[18] = '' sums[18] = ''
@ -375,6 +393,25 @@ export default {
this.allMoneyMoveDiscount = sums[13] - sums[16] this.allMoneyMoveDiscount = sums[13] - sums[16]
return sums return sums
}, },
getdiscountMoney(row) {
row.discountMoney = row.discountRate * row.arrivalQuantity * (1 - row.discountRate / 100)
return row.discountMoney
},
//
getTaxMoney2(row) {
row.taxMoney = (row.price * row.taxRate / 100 * row.arrivalQuantity).toFixed(2)
return row.taxMoney
},
//
getTaxMoney(row) {
row.includeTaxMoney = (row.arrivalQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney
},
//
getMoney(row) {
row.money = (row.arrivalQuantity * row.price).toFixed(2)
return row.money
},
getways() { getways() {
// //
searchCategory(2).then(res => { searchCategory(2).then(res => {
@ -421,6 +458,7 @@ export default {
allOrderinfo(val) { allOrderinfo(val) {
this.personalForm.supplierId = val.supplierId this.personalForm.supplierId = val.supplierId
this.supplierId = val.supplierName this.supplierId = val.supplierName
this.allOthermoney = val.otherMoney
}, },
// //
updatecountry() { updatecountry() {
@ -561,6 +599,9 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }

View file

@ -152,12 +152,32 @@
<el-editable-column prop="giveDate" align="center" label="交货日期" min-width="170px"/> <el-editable-column prop="giveDate" align="center" label="交货日期" min-width="170px"/>
<el-editable-column prop="price" align="center" label="单价" min-width="170px"/> <el-editable-column prop="price" align="center" label="单价" min-width="170px"/>
<el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/> <el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/> <el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px">
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/> <template slot-scope="scope">
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/> <p>{{ gettaxRate(scope.row) }}</p>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/> </template>
</el-editable-column>
<el-editable-column prop="money" align="center" label="金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/> <el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot-scope="scope">
<p>{{ getdiscountMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="remark" align="center" label="备注" min-width="150px"/> <el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
@ -394,6 +414,28 @@ export default {
this.allMoneyMoveDiscount = sums[13] - sums[16] this.allMoneyMoveDiscount = sums[13] - sums[16]
return sums return sums
}, },
getdiscountMoney(row) {
row.discountMoney = row.discountRate * row.arrivalQuantity * (1 - row.discountRate / 100)
return row.discountMoney
},
//
getTaxMoney2(row) {
row.taxMoney = (row.price * row.taxRate / 100 * row.arrivalQuantity).toFixed(2)
return row.taxMoney
},
//
getTaxMoney(row) {
row.includeTaxMoney = (row.arrivalQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney
},
//
getMoney(row) {
row.money = (row.arrivalQuantity * row.price).toFixed(2)
return row.money
},
gettaxRate(row) {
return row.taxRate * 100
},
getways() { getways() {
// //
searchCategory(2).then(res => { searchCategory(2).then(res => {

View file

@ -363,11 +363,11 @@ export default {
giveDate: item.deliveryDate, giveDate: item.deliveryDate,
price: item.price, price: item.price,
includeTaxPrice: item.includeTaxPrice, includeTaxPrice: item.includeTaxPrice,
taxRate: item.taxRate, taxRate: item.taxRate * 100,
money: item.money, money: item.money,
includeTaxMoney: item.includeTaxMoney, includeTaxMoney: item.includeTaxMoney,
taxMoney: item.tax, taxMoney: item.tax,
discountRate: item.discountRate, discountRate: item.discountRate * 100,
discountMoney: item.discountMoney, discountMoney: item.discountMoney,
remark: item.remarks, remark: item.remarks,
sourceNumber: number, sourceNumber: number,

View file

@ -24,13 +24,13 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockContract.supplierId')" prop="supplierId" style="width: 100%;"> <el-form-item :label="$t('StockContract.supplierId')" prop="supplierId" style="width: 100%;">
<el-input v-model="supplierId" style="margin-left: 18px" clearable @focus="handlechoose"/> <el-input v-model="supplierId" style="margin-left: 18px" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/> <my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockContract.stockPersonId')" prop="stockPersonId" style="width: 100%;"> <el-form-item :label="$t('StockContract.stockPersonId')" prop="stockPersonId" style="width: 100%;">
<el-input v-model="stockPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="stockPersonId" style="margin-left: 18px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -300,9 +300,25 @@ export default {
components: { MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp }, components: { MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.supplierId)
if (value === '') { if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
callback(new Error('请选择')) callback(new Error('请选择供应商'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.inquiryPersonId)
if (this.inquiryPersonId === undefined || this.inquiryPersonId === null || this.inquiryPersonId === '') {
callback(new Error('请选择我方签约人'))
} else {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.inquiryPersonId)
if (this.stockPersonId === undefined || this.stockPersonId === null || this.stockPersonId === '') {
callback(new Error('请选择采购员'))
} else { } else {
callback() callback()
} }
@ -367,10 +383,13 @@ export default {
// //
personalrules: { personalrules: {
supplierId: [ supplierId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
inquiryPersonId: [ inquiryPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass2, trigger: 'change' }
],
stockPersonId: [
{ required: true, validator: validatePass3, trigger: 'change' }
], ],
inquiryDate: [ inquiryDate: [
{ required: true, message: '请选择询价日期', trigger: 'change' } { required: true, message: '请选择询价日期', trigger: 'change' }
@ -411,7 +430,7 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return (prev + curr).toFixed(2)
} else { } else {
return (prev).toFixed(2) return (prev).toFixed(2)
} }
@ -479,31 +498,34 @@ export default {
}, },
// //
gettaxRate(row) { gettaxRate(row) {
row.includeTaxPrice = row.price * (1 + row.taxRate / 100) if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
}, },
// //
getincludeTaxPrice(row) { getincludeTaxPrice(row) {
if (row.price !== 0) { if (row.price !== 0) {
row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2) row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
} }
}, },
// //
getprice(row) { getprice(row) {
row.includeTaxPrice = row.price * (1 + row.taxRate) row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}, },
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.taxMoney = row.price * row.taxRate * row.plannedQuantity row.taxMoney = (row.price * row.taxRate / 100 * row.plannedQuantity).toFixed(2)
return row.taxMoney return row.taxMoney
}, },
// //
getTaxMoney(row) { getTaxMoney(row) {
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney return row.includeTaxMoney
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.plannedQuantity * row.price row.money = (row.plannedQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //

View file

@ -497,31 +497,34 @@ export default {
}, },
// //
gettaxRate(row) { gettaxRate(row) {
row.includeTaxPrice = row.price * (1 + row.taxRate / 100) if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
}, },
// //
getincludeTaxPrice(row) { getincludeTaxPrice(row) {
if (row.price !== 0) { if (row.price !== 0) {
row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2) row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
} }
}, },
// //
getprice(row) { getprice(row) {
row.includeTaxPrice = row.price * (1 + row.taxRate) row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}, },
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.taxMoney = row.price * row.taxRate * row.plannedQuantity row.taxMoney = (row.price * row.taxRate / 100 * row.plannedQuantity).toFixed(2)
return row.taxMoney return row.taxMoney
}, },
// //
getTaxMoney(row) { getTaxMoney(row) {
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney return row.includeTaxMoney
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.plannedQuantity * row.price row.money = (row.plannedQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //
@ -755,6 +758,9 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }

View file

@ -23,19 +23,19 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockInquiry.supplierId')" prop="supplierId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.supplierId')" prop="supplierId" style="width: 100%;">
<el-input v-model="supplierId" style="margin-left: 18px" clearable @focus="handlechoose"/> <el-input v-model="supplierId" style="margin-left: 18px;width: 218px" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/> <my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockInquiry.inquiryPersonId')" prop="inquiryPersonId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.inquiryPersonId')" prop="inquiryPersonId" style="width: 100%;">
<el-input v-model="inquiryPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="inquiryPersonId" style="margin-left: 18px;width: 218px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockInquiry.stockTypeId')" prop="stockTypeId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.stockTypeId')" prop="stockTypeId" style="width: 100%;">
<el-select v-model="personalForm.stockTypeId" style="margin-left: 18px;width: 218px" @focus="updatecountry"> <el-select v-model="personalForm.stockTypeId" :disabled="IsStockTypeId" style="margin-left: 18px;width: 218px" @focus="updatecountry">
<el-option <el-option
v-for="(item, index) in types" v-for="(item, index) in types"
:key="index" :key="index"
@ -46,7 +46,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockInquiry.deptId')" prop="deptId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.deptId')" prop="deptId" style="width: 100%;">
<el-select v-model="personalForm.deptId" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.deptId" :disabled="IsDeptId" clearable style="margin-left: 18px;width: 218px">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -66,7 +66,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockInquiry.inquiryTimes')" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.inquiryTimes')" style="width: 100%;">
<el-input v-model="personalForm.inquiryTimes" style="margin-left: 18px" clearable/> <el-input v-model="personalForm.inquiryTimes" disabled style="margin-left: 18px;width: 218px" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -94,10 +94,10 @@
<h2 ref="fuzhu" class="form-name" >采购询价单明细</h2> <h2 ref="fuzhu" class="form-name" >采购询价单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;"> <div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" :supp.sync="supp" @product="productdetail"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
<my-plan :plancontrol.sync="plancontrol" @plan="plan"/> <my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allinfo="allinfo"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
<div class="container"> <div class="container">
@ -118,11 +118,27 @@
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="170px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="170px">
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="planDeliveryDate" align="center" label="交货日期" min-width="170px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:disabled="IsPlannedQuantity"
:precision="2"
v-model="scope.row.plannedQuantity"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="planDeliveryDate" align="center" label="交货日期" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-date-picker
v-model="scope.row.planDeliveryDate"
:disabled="IsPlannedQuantity"
type="date"
value-format="yyyy-MM-dd"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0, precision: 2}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-input-number
:precision="2"
v-model="scope.row.price" v-model="scope.row.price"
@input="getprice(scope.row)"/> @input="getprice(scope.row)"/>
</template> </template>
@ -130,11 +146,19 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.includeTaxPrice" v-model="scope.row.includeTaxPrice"
@input="getincludeTaxPrice(scope.row)"/> @input="getincludeTaxPrice(scope.row)"/>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0, max: 1}, type: 'visible'}" prop="taxRate" align="center" label="税率" min-width="170px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-input-number
:precision="2"
v-model="scope.row.taxRate"
@input="gettaxRate(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"> <el-editable-column prop="money" align="center" label="金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ getMoney(scope.row) }}</p> <p>{{ getMoney(scope.row) }}</p>
@ -180,14 +204,30 @@ export default {
components: { MyPlan, MyApply, MySupplier, MyDetail, MyEmp }, components: { MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.supplierId)
if (value === '') { if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
callback(new Error('请选择')) callback(new Error('请选择供应商'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.supplierId)
if (this.inquiryPersonId === undefined || this.inquiryPersonId === null || this.inquiryPersonId === '') {
callback(new Error('请选择询价员'))
} else { } else {
callback() callback()
} }
} }
return { return {
//
IsPlannedQuantity: false,
//
IsStockTypeId: false,
//
IsDeptId: false,
// id
supp: null,
// //
plancontrol: false, plancontrol: false,
// //
@ -223,15 +263,17 @@ export default {
countryId: 1, countryId: 1,
repositoryId: 438, repositoryId: 438,
regionId: 2, regionId: 2,
isVat: 1 isVat: 1,
inquiryTimes: 1,
currency: '1'
}, },
// //
personalrules: { personalrules: {
supplierId: [ supplierId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
inquiryPersonId: [ inquiryPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass2, trigger: 'change' }
], ],
inquiryDate: [ inquiryDate: [
{ required: true, message: '请选择询价日期', trigger: 'change' } { required: true, message: '请选择询价日期', trigger: 'change' }
@ -250,26 +292,43 @@ export default {
list2: [], list2: [],
// //
validRules: { validRules: {
planDeliveryDate: [
{ required: true, message: '请选择交货日期', trigger: 'change' }
],
plannedQuantity: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
]
} }
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
this.getdatatime()
}, },
methods: { methods: {
// getdatatime() { //
this.personalForm.inquiryDate = new Date()
},
//
gettaxRate(row) {
if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
},
//
getincludeTaxPrice(row) { getincludeTaxPrice(row) {
if (row.price !== 0) { if (row.price !== 0) {
row.taxRate = (row.includeTaxPrice / row.price - 1).toFixed(4) row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
} }
}, },
// //
getprice(row) { getprice(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate)).toFixed(2) row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}, },
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.taxMoney = (row.price * row.taxRate * row.plannedQuantity).toFixed(2) row.taxMoney = (row.price * (row.taxRate / 100) * row.plannedQuantity).toFixed(2)
return row.taxMoney return row.taxMoney
}, },
// //
@ -279,22 +338,36 @@ export default {
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.plannedQuantity * row.price row.money = (row.plannedQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //
chooseType() { chooseType() {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') { if (this.personalForm.sourceType === '1') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() this.IsStockTypeId = true
this.$refs.editable2.clear() this.IsDeptId = true
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '2') {
this.addsouce = false
this.addpro = false
this.IsStockTypeId = true
this.IsDeptId = true
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() this.IsStockTypeId = false
this.$refs.editable2.clear() this.IsDeptId = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} }
}, },
// //
@ -302,12 +375,21 @@ export default {
if (this.personalForm.sourceType === '1') { if (this.personalForm.sourceType === '1') {
this.applycontrol = true this.applycontrol = true
} else if (this.personalForm.sourceType === '2') { } else if (this.personalForm.sourceType === '2') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.plancontrol = true this.plancontrol = true
} }
}, },
// //
apply(val) { apply(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = true
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
@ -323,10 +405,20 @@ export default {
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
allapplyinfo(val) {
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.applyDeptId
},
allinfo(val) {
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.stockDeptId
},
// //
plan(val) { plan(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = true
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
const quchonggong = this.personalForm.supplierId
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) { if (val[i].productCode === nowlistdata[j].productCode) {
@ -338,6 +430,9 @@ export default {
return false return false
} }
} }
if (val[i].supplierId !== quchonggong) {
continue
}
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
@ -365,9 +460,9 @@ export default {
}, },
// //
supplierName(val) { supplierName(val) {
console.log(val)
this.supplierId = val.supplierName this.supplierId = val.supplierName
this.personalForm.supplierId = val.id this.personalForm.supplierId = val.id
this.supp = val.id
}, },
// focus // focus
handlechooseStock() { handlechooseStock() {
@ -380,10 +475,19 @@ export default {
}, },
// //
handleAddproduct() { handleAddproduct() {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.control = true this.control = true
}, },
productdetail(val) { productdetail(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = false
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
console.log(val[i].price) console.log(val[i].price)
@ -468,9 +572,15 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.money === null || elem.money === '' || elem.money === undefined) { if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money delete elem.money
} }
@ -492,26 +602,30 @@ export default {
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
createstockInquiry(parms, parms2, this.personalForm).then(res => { this.$refs.editable.validate().then(valid => {
console.log(res) createstockInquiry(parms, parms2, this.personalForm).then(res => {
if (res.data.ret === 200) { console.log(res)
this.$notify({ if (res.data.ret === 200) {
title: '成功', this.$notify({
message: '保存成功', title: '成功',
type: 'success', message: '保存成功',
offset: 100 type: 'success',
}) offset: 100
this.restAllForm() })
this.$refs.editable.clear() this.restAllForm()
this.$refs.personalForm.clearValidate() this.$refs.editable.clear()
this.$refs.personalForm.resetFields() this.$refs.personalForm.clearValidate()
} else { this.$refs.personalForm.resetFields()
this.$notify.error({ } else {
title: '错误', this.$notify.error({
message: res.data.msg, title: '错误',
offset: 100 message: res.data.msg,
}) offset: 100
} })
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
} else { } else {
this.$notify.error({ this.$notify.error({

View file

@ -145,7 +145,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('StockInquiry.stockTypeId')" :resizable="false" align="center" min-width="150"> <el-table-column :label="$t('StockInquiry.stockTypeId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.stockTypeId | stockTypeFilter }}</span> <span>{{ scope.row.stockTypeName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('StockInquiry.sourceType')" :resizable="false" align="center" min-width="150"> <el-table-column :label="$t('StockInquiry.sourceType')" :resizable="false" align="center" min-width="150">

View file

@ -145,7 +145,7 @@
import { stocapplylist } from '@/api/StockApply' import { stocapplylist } from '@/api/StockApply'
import { getdeptlist } from '@/api/BasicSettings' import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory' import { searchStockCategory } from '@/api/StockCategory'
import { productlist } from '@/api/public' // import { productlist } from '@/api/public'
import waves from '@/directive/waves' // Waves directive import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import MyEmp from '../../StockApply/components/MyEmp' import MyEmp from '../../StockApply/components/MyEmp'
@ -320,6 +320,7 @@ export default {
// //
async handleConfirm() { async handleConfirm() {
this.employeeVisible = false this.employeeVisible = false
console.log(this.choosedata)
const applydata = this.choosedata.stockApplyDetailVos const applydata = this.choosedata.stockApplyDetailVos
const number = this.choosedata.applyNumber const number = this.choosedata.applyNumber
const applyDetail = applydata.map(function(item) { const applyDetail = applydata.map(function(item) {
@ -331,7 +332,7 @@ export default {
type: item.typeId, type: item.typeId,
unit: item.unit, unit: item.unit,
color: item.color, color: item.color,
plannedQuantity: item.planQuantity, plannedQuantity: item.requireQuantity,
planDeliveryDate: item.requireDate, planDeliveryDate: item.requireDate,
applicationReason: item.applyReason, applicationReason: item.applyReason,
sourceNumber: number, sourceNumber: number,
@ -339,23 +340,9 @@ export default {
price: '' price: ''
} }
}) })
const list = await Promise.all(applydata.map(function(item) {
return productlist(item.productCode)
}))
for (let i = 0; i < applyDetail.length; i++) {
for (let j = 0; j < list.length; j++) {
if (applyDetail[i].productCode === list[j].data.data.content.list[0].code) {
applyDetail[i].price = list[j].data.data.content.list[0].purchasePrice
applyDetail[i].includeTaxPrice = list[j].data.data.content.list[0].purchasePrice
}
}
}
console.log(applydata[0].price)
this.$emit('apply', applyDetail) this.$emit('apply', applyDetail)
this.$emit('apply2', applyDetail) this.$emit('apply2', applyDetail)
this.$emit('allinfo', this.choosedata) this.$emit('allapplyinfo', this.choosedata)
} }
// //
} }

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="productVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择商品" append-to-body @close="$emit('update:control', false)"> <el-dialog :visible.sync="productVisible" :control="control" :supp="supp" :close-on-press-escape="false" top="10px" title="选择商品" append-to-body @close="$emit('update:control', false)">
<div class="filter-container"> <div class="filter-container">
<!-- 搜索条件栏目 --> <!-- 搜索条件栏目 -->
<el-input v-model="getemplist.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/> <el-input v-model="getemplist.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
@ -136,6 +136,10 @@ export default {
control: { control: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -173,6 +177,7 @@ export default {
typeid: '', typeid: '',
isactive: '', isactive: '',
Productid: '', Productid: '',
supplierid: this.supp,
pagenum: 1, pagenum: 1,
pagesize: 10 pagesize: 10
} }
@ -182,7 +187,11 @@ export default {
control() { control() {
this.productVisible = this.control this.productVisible = this.control
console.log(this.control) console.log(this.control)
},
supp() {
this.getemplist.supplierid = this.supp
this.getlist() this.getlist()
console.log(this.supp)
} }
}, },
created() { created() {

View file

@ -34,7 +34,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockInquiry.stockTypeId')" prop="stockTypeId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.stockTypeId')" prop="stockTypeId" style="width: 100%;">
<el-select v-model="personalForm.stockTypeId" style="margin-left: 18px;width: 200px" @focus="updatecountry"> <el-select v-model="personalForm.stockTypeId" :disabled="IsStockTypeId" style="margin-left: 18px;width: 200px" @focus="updatecountry">
<el-option <el-option
v-for="(item, index) in types" v-for="(item, index) in types"
:key="index" :key="index"
@ -45,7 +45,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockInquiry.deptId')" prop="deptId" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.deptId')" prop="deptId" style="width: 100%;">
<el-select v-model="personalForm.deptId" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.deptId" :disabled="IsDeptId" clearable style="margin-left: 18px;width: 200px">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -65,7 +65,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockInquiry.inquiryTimes')" style="width: 100%;"> <el-form-item :label="$t('StockInquiry.inquiryTimes')" style="width: 100%;">
<el-input v-model="personalForm.inquiryTimes" style="margin-left: 18px;width: 200px" clearable/> <el-input v-model="personalForm.inquiryTimes" disabled style="margin-left: 18px;width: 200px" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -93,10 +93,10 @@
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购询价单明细</h2> <h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购询价单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;"> <div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" :supp.sync="supp" @product="productdetail"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
<my-plan :plancontrol.sync="plancontrol" @plan="plan"/> <my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allinfo="allinfo"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
<div class="container"> <div class="container">
@ -114,25 +114,61 @@
<el-editable-column label="序号" min-width="55" align="center" type="index"/> <el-editable-column label="序号" min-width="55" align="center" type="index"/>
<el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/> <el-editable-column prop="productCode" align="center" label="物品编号" min-width="150px"/>
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="typeName" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="color" align="center" label="颜色" min-width="150px"/> <el-editable-column prop="color" align="center" label="颜色" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="170px">
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="planDeliveryDate" align="center" label="交货日期" min-width="160px"/> <template slot="edit" slot-scope="scope">
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="150px"/> <el-input-number
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="150px"/> :disabled="IsPlannedQuantity"
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率" min-width="150px"/> :precision="2"
v-model="scope.row.plannedQuantity"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="planDeliveryDate" align="center" label="交货日期" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-date-picker
v-model="scope.row.planDeliveryDate"
:disabled="IsPlannedQuantity"
type="date"
value-format="yyyy-MM-dd"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0, precision: 2}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-input-number
:precision="2"
v-model="scope.row.price"
@input="getprice(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-input-number
:precision="2"
v-model="scope.row.includeTaxPrice"
@input="getincludeTaxPrice(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px">
<template slot="edit" slot-scope="scope">
<el-input-number
:precision="2"
v-model="scope.row.taxRate"
@input="gettaxRate(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"> <el-editable-column prop="money" align="center" label="金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ getMoney(scope.row) }}</p> <p>{{ getMoney(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"> <el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="170px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p> <p>{{ getTaxMoney(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"> <el-editable-column prop="taxMoney" align="center" label="税额" min-width="170px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p> <p>{{ getTaxMoney2(scope.row) }}</p>
</template> </template>
@ -176,14 +212,30 @@ export default {
}, },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.supplierId)
if (value === '') { if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
callback(new Error('请选择')) callback(new Error('请选择供应商'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.supplierId)
if (this.inquiryPersonId === undefined || this.inquiryPersonId === null || this.inquiryPersonId === '') {
callback(new Error('请选择询价员'))
} else { } else {
callback() callback()
} }
} }
return { return {
//
IsPlannedQuantity: false,
//
IsStockTypeId: false,
//
IsDeptId: false,
// id
supp: null,
// //
choosedata: [], choosedata: [],
// //
@ -220,10 +272,10 @@ export default {
// //
personalrules: { personalrules: {
supplierId: [ supplierId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
inquiryPersonId: [ inquiryPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass2, trigger: 'change' }
], ],
inquiryDate: [ inquiryDate: [
{ required: true, message: '请选择询价日期', trigger: 'change' } { required: true, message: '请选择询价日期', trigger: 'change' }
@ -242,6 +294,12 @@ export default {
list2: [], list2: [],
// //
validRules: { validRules: {
planDeliveryDate: [
{ required: true, message: '请选择交货日期', trigger: 'change' }
],
plannedQuantity: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
]
} }
} }
}, },
@ -261,34 +319,65 @@ export default {
this.getTypes() this.getTypes()
}, },
methods: { methods: {
//
gettaxRate(row) {
if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
},
//
getincludeTaxPrice(row) {
if (row.price !== 0) {
row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
}
},
//
getprice(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
},
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.taxMoney = row.price * row.taxRate row.taxMoney = (row.price * (row.taxRate / 100) * row.plannedQuantity).toFixed(2)
return row.taxMoney return row.taxMoney
}, },
// //
getTaxMoney(row) { getTaxMoney(row) {
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney return row.includeTaxMoney
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.plannedQuantity * row.price row.money = (row.plannedQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //
chooseType() { chooseType() {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') { if (this.personalForm.sourceType === '1') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() this.IsStockTypeId = true
this.$refs.editable2.clear() this.IsDeptId = true
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '2') {
this.addsouce = false
this.addpro = false
this.IsStockTypeId = true
this.IsDeptId = true
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() this.IsStockTypeId = false
this.$refs.editable2.clear() this.IsDeptId = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} }
}, },
// //
@ -296,12 +385,21 @@ export default {
if (this.personalForm.sourceType === '1') { if (this.personalForm.sourceType === '1') {
this.applycontrol = true this.applycontrol = true
} else if (this.personalForm.sourceType === '2') { } else if (this.personalForm.sourceType === '2') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.plancontrol = true this.plancontrol = true
} }
}, },
// //
apply(val) { apply(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = true
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
@ -317,9 +415,19 @@ export default {
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
allapplyinfo(val) {
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.applyDeptId
},
allinfo(val) {
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.stockDeptId
},
// //
plan(val) { plan(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = true
const quchonggong = this.personalForm.supplierId
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
@ -332,6 +440,9 @@ export default {
return false return false
} }
} }
if (val[i].supplierId !== quchonggong) {
continue
}
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
@ -362,6 +473,7 @@ export default {
console.log(val) console.log(val)
this.supplierId = val.supplierName this.supplierId = val.supplierName
this.personalForm.supplierId = val.id this.personalForm.supplierId = val.id
this.supp = val.id
}, },
// focus // focus
handlechooseStock() { handlechooseStock() {
@ -374,10 +486,19 @@ export default {
}, },
// //
handleAddproduct() { handleAddproduct() {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.control = true this.control = true
}, },
productdetail(val) { productdetail(val) {
console.log(val) console.log(val)
this.IsPlannedQuantity = false
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
console.log(val[i].price) console.log(val[i].price)
@ -468,9 +589,15 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.money === null || elem.money === '' || elem.money === undefined) { if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money delete elem.money
} }
@ -490,26 +617,41 @@ export default {
} }
} }
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
updatestockInquiry(parms, parms2).then(res => { this.$refs.personalForm.validate((valid) => {
if (res.data.ret === 200) { if (valid) {
this.$notify({ this.$refs.editable.validate().then(valid => {
title: '操作成功', updatestockInquiry(parms, parms2).then(res => {
message: '操作成功', if (res.data.ret === 200) {
type: 'success', this.$notify({
duration: 1000, title: '操作成功',
offset: 100 message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else { } else {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
message: '出错了', message: '信息未填完整',
offset: 100 offset: 100
}) })
return false
} }
}) })
}, },
@ -536,6 +678,7 @@ export default {
} }
.edit >>> .el-dialog { .edit >>> .el-dialog {
background:#f1f1f1 ; background:#f1f1f1 ;
height: 900px;
} }
.el-col-12{ .el-col-12{
width: 49%; width: 49%;

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="employeeVisible" :plancontrol="plancontrol" :close-on-press-escape="false" top="10px" title="选择采购计划单" append-to-body width="1100px" @close="$emit('update:plancontrol', false)"> <el-dialog :visible.sync="employeeVisible" :plancontrol="plancontrol" :supp="supp" :close-on-press-escape="false" top="10px" title="选择采购计划单" append-to-body width="1100px" @close="$emit('update:plancontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never"> <el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row> <el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px"> <el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
@ -181,6 +181,10 @@ export default {
plancontrol: { plancontrol: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -228,6 +232,7 @@ export default {
pageSize: 10, pageSize: 10,
repositoryId: 438, repositoryId: 438,
regionIds: 2, regionIds: 2,
supplierId: this.supp,
createPersonId: 3 createPersonId: 3
}, },
// //
@ -241,6 +246,11 @@ export default {
watch: { watch: {
plancontrol() { plancontrol() {
this.employeeVisible = this.plancontrol this.employeeVisible = this.plancontrol
},
supp() {
this.getemplist.supplierId = this.supp
this.getlist()
console.log(this.supp)
} }
}, },
created() { created() {
@ -332,7 +342,8 @@ export default {
sourceNumber: number, sourceNumber: number,
sourceSerialNumber: item.id, sourceSerialNumber: item.id,
price: item.basicPrice, price: item.basicPrice,
includeTaxPrice: item.basicPrice includeTaxPrice: item.basicPrice,
supplierId: item.supplierId
} }
}) })
console.log(applyDetail) console.log(applyDetail)

View file

@ -25,19 +25,19 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.supplierId')" prop="supplierId" style="width: 100%;"> <el-form-item :label="$t('StockOrder.supplierId')" prop="supplierId" style="width: 100%;">
<el-input v-model="supplierId" style="margin-left: 18px" clearable @focus="handlechoose"/> <el-input v-model="supplierId" style="margin-left: 18px;width: 218px" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/> <my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.stockPersonId')" prop="stockPersonId" style="width: 100%;"> <el-form-item :label="$t('StockOrder.stockPersonId')" prop="stockPersonId" style="width: 100%;">
<el-input v-model="stockPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="stockPersonId" :disabled="IsStockPersonId" style="margin-left: 18px;width: 218px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.stockType')" prop="stockType" style="width: 100%;"> <el-form-item :label="$t('StockOrder.stockType')" prop="stockType" style="width: 100%;">
<el-select v-model="personalForm.stockTypeId" style="margin-left: 18px;width: 218px" @focus="updatecountry"> <el-select v-model="personalForm.stockTypeId" :disabled="IsStockTypeId" style="margin-left: 18px;width: 218px" @focus="updatecountry">
<el-option <el-option
v-for="(item, index) in types" v-for="(item, index) in types"
:key="index" :key="index"
@ -48,7 +48,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.deptId')" prop="deptId" style="width: 100%;"> <el-form-item :label="$t('StockOrder.deptId')" prop="deptId" style="width: 100%;">
<el-select v-model="personalForm.deptId" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.deptId" :disabled="IsDeptId" style="margin-left: 18px;width: 218px" @change="change()">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -59,29 +59,30 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.payMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.payMode')" style="width: 100%;">
<el-select v-model="personalForm.payMode" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.payMode" :disabled="IsPayMode" clearable style="margin-left: 18px;width: 218px">
<el-option value="1" label="现金"/> <el-option value="1" label="现金"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.orderDate')" prop="signDate" style="width: 100%;"> <el-form-item :label="$t('StockOrder.orderDate')" prop="orderDate" style="width: 100%;">
<el-date-picker <el-date-picker
v-model="personalForm.orderDate" v-model="personalForm.orderDate"
:picker-options="pickerOptions1"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="margin-left: 18px"/> style="margin-left: 18px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.signPersonId')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.signPersonId')" prop="signPersonId" style="width: 100%;">
<el-input v-model="signPersonId" style="margin-left: 18px" clearable @focus="handlechooseDelivery"/> <el-input v-model="signPersonId" :disabled="IsSignPersonId" style="margin-left: 18px;width: 218px" @focus="handlechooseDelivery"/>
</el-form-item> </el-form-item>
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/> <my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.deliveryMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.deliveryMode')" style="width: 100%;">
<el-select v-model="personalForm.deliveryMode" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.deliveryMode" :disabled="IsDeliveryMode" clearable style="margin-left: 18px;width: 218px">
<el-option <el-option
v-for="(item, index) in giveIds" v-for="(item, index) in giveIds"
:key="index" :key="index"
@ -93,7 +94,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.settleMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.settleMode')" style="width: 100%;">
<el-select v-model="personalForm.settleMode" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.settleMode" :disabled="IsSettleMode" clearable style="margin-left: 18px;width: 218px">
<el-option <el-option
v-for="(item, index) in paymentIds" v-for="(item, index) in paymentIds"
:key="index" :key="index"
@ -113,12 +114,17 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockOrder.currency')" prop="currency" style="width: 100%;"> <el-form-item :label="$t('StockOrder.currency')" prop="currency" style="width: 100%;">
<el-select v-model="personalForm.currency" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.currency" :disabled="IsCurrency" clearable style="margin-left: 18px;width: 218px">
<el-option value="1" label="RMB"/> <el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/> <el-option value="2" label="USD"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item :label="$t('StockOrder.supplierNumber')" style="width: 100%;">
<el-input v-model="personalForm.supplierNumber" style="margin-left: 18px" clearable/>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
@ -128,12 +134,12 @@
<h2 ref="fuzhu" class="form-name" >采购订单明细</h2> <h2 ref="fuzhu" class="form-name" >采购订单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;"> <div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" :supp.sync="supp" @product="productdetail"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
<my-plan :plancontrol.sync="plancontrol" @plan="plan" @allPlaninfo="allPlaninfo"/> <my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allPlaninfo="allPlaninfo"/>
<my-lnquiry :inquirycontrol.sync="inquirycontrol" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/> <my-lnquiry :inquirycontrol.sync="inquirycontrol" :supp.sync="supp" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
<my-contract :contractcontrol.sync="contractcontrol" @contract="contract" @allcontractinfo="allcontractinfo"/> <my-contract :contractcontrol.sync="contractcontrol" :supp.sync="supp" @contract="contract" @allcontractinfo="allcontractinfo"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
<div class="container"> <div class="container">
@ -155,10 +161,11 @@
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="stockQuantity" align="center" label="采购数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="stockQuantity" align="center" label="采购数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.price" v-model="scope.row.price"
@input="getprice(scope.row)"/> @input="getprice(scope.row)"/>
</template> </template>
@ -166,6 +173,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.includeTaxPrice" v-model="scope.row.includeTaxPrice"
@input="getincludeTaxPrice(scope.row)"/> @input="getincludeTaxPrice(scope.row)"/>
</template> </template>
@ -173,6 +181,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.taxRate" v-model="scope.row.taxRate"
@input="gettaxRate(scope.row)"/> @input="gettaxRate(scope.row)"/>
</template> </template>
@ -196,6 +205,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountRate" align="center" label="折扣率(%)" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountRate" align="center" label="折扣率(%)" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.discountRate" v-model="scope.row.discountRate"
@input="getdiscountRate(scope.row)"/> @input="getdiscountRate(scope.row)"/>
</template> </template>
@ -203,6 +213,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountMoney" align="center" label="折扣额" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.discountMoney" v-model="scope.row.discountMoney"
@input="getdiscountMoney(scope.row)"/> @input="getdiscountMoney(scope.row)"/>
</template> </template>
@ -250,7 +261,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="折后含税金额合计" style="width: 100%;"> <el-form-item label="其他费用支出合计" style="width: 100%;">
<el-input v-model="personalForm.otherMoney" style="margin-left: 18px"/> <el-input v-model="personalForm.otherMoney" style="margin-left: 18px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -286,14 +297,63 @@ export default {
components: { MyContract, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp }, components: { MyContract, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.supplierId)
if (value === '') { if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
callback(new Error('请选择')) callback(new Error('请选择供应商'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.signPersonId)
if (this.signPersonId === undefined || this.signPersonId === null || this.signPersonId === '') {
callback(new Error('请选择签约人'))
} else {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.stockPersonId)
if (this.stockPersonId === undefined || this.stockPersonId === null || this.stockPersonId === '') {
callback(new Error('请选择采购员'))
} else {
callback()
}
}
const validatePass4 = (rule, value, callback) => {
console.log(this.personalForm.deptId)
if (this.personalForm.deptId === undefined || this.personalForm.deptId === null || this.personalForm.deptId === '') {
callback(new Error('请选择部门'))
} else { } else {
callback() callback()
} }
} }
return { return {
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
}
},
//
supp: null,
//
IsCurrency: false,
//
IsSignPersonId: false,
//
IsPayMode: false,
//
IsSettleMode: false,
//
IsDeliveryMode: false,
//
IsSupplierId: false,
//
IsStockPersonId: false,
//
IsStockTypeId: false,
//
IsDeptId: false,
// //
allNumber: '', allNumber: '',
allMoney: '', allMoney: '',
@ -351,21 +411,26 @@ export default {
countryId: 1, countryId: 1,
repositoryId: 438, repositoryId: 438,
regionId: 2, regionId: 2,
isVat: 1 isVat: 1,
sourceType: '5',
currency: '1'
}, },
// //
personalrules: { personalrules: {
signPersonId: [
{ required: true, validator: validatePass2, trigger: 'change' }
],
stockPersonId: [
{ required: true, validator: validatePass3, trigger: 'change' }
],
supplierId: [ supplierId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
inquiryPersonId: [ orderDate: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
inquiryDate: [
{ required: true, message: '请选择询价日期', trigger: 'change' } { required: true, message: '请选择询价日期', trigger: 'change' }
], ],
deptId: [ deptId: [
{ required: true, message: '请选择部门', trigger: 'change' } { required: true, validator: validatePass4, trigger: 'change' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
@ -378,14 +443,29 @@ export default {
list2: [], list2: [],
// //
validRules: { validRules: {
name: [
{ required: true, message: '请输入名称', trigger: 'change' }
],
stockQuantity: [
{ required: true, message: '请输入采购数量', trigger: 'blur' }
]
} }
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
this.chooseType()
this.getways() this.getways()
this.getdatatime()
}, },
methods: { methods: {
//
change() {
this.$forceUpdate()
},
getdatatime() { //
this.personalForm.orderDate = new Date()
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -400,9 +480,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return (Number(prev) + Number(curr)).toFixed(2)
} else { } else {
return (prev).toFixed(2) return (Number(prev)).toFixed(2)
} }
}, 0) }, 0)
sums[index] += '' sums[index] += ''
@ -414,21 +494,21 @@ export default {
sums[3] = '' sums[3] = ''
sums[4] = '' sums[4] = ''
sums[5] = '' sums[5] = ''
sums[6] = '' sums[7] = ''
sums[8] = '' sums[8] = ''
sums[9] = '' sums[9] = ''
sums[10] = '' sums[13] = ''
sums[14] = '' sums[14] = ''
sums[15] = '' sums[16] = ''
sums[17] = '' sums[17] = ''
sums[18] = '' sums[18] = ''
sums[19] = '' sums[19] = ''
this.allNumber = sums[7] this.allNumber = sums[6]
this.allMoney = sums[11] this.allMoney = sums[10]
this.allTaxMoney = sums[13] this.allTaxMoney = sums[12]
this.allIncludeTaxMoney = sums[12] this.allIncludeTaxMoney = sums[11]
this.allDiscountMoney = sums[16] this.allDiscountMoney = sums[15]
this.allMoneyMoveDiscount = sums[12] - sums[16] this.allMoneyMoveDiscount = sums[11] - sums[15]
return sums return sums
}, },
getways() { getways() {
@ -468,57 +548,152 @@ export default {
}, },
// //
gettaxRate(row) { gettaxRate(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2) if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
}, },
// //
getincludeTaxPrice(row) { getincludeTaxPrice(row) {
if (row.price !== 0) { if (row.price !== 0) {
row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2) row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
} }
}, },
// //
getprice(row) { getprice(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate)).toFixed(2) row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}, },
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.tax = (row.price * row.taxRate * row.stockQuantity).toFixed(2) row.tax = (row.price * row.taxRate / 100 * row.stockQuantity).toFixed(2)
return row.tax return row.tax
}, },
// //
getTaxMoney(row) { getTaxMoney(row) {
row.includeTaxMoney = row.stockQuantity * row.includeTaxPrice row.includeTaxMoney = (row.stockQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney return row.includeTaxMoney
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.stockQuantity * row.price row.money = (row.stockQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //
chooseType() { chooseType() {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4') { if (this.personalForm.sourceType === '1') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() this.IsStockTypeId = true
this.IsDeptId = true
this.IsSupplierId = false
this.IsStockPersonId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '2') {
this.addsouce = false
this.addpro = false
this.IsStockTypeId = true
this.IsDeptId = true
this.IsStockPersonId = true
this.IsSupplierId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '3') {
this.addsouce = false
this.addpro = false
this.IsSupplierId = true
this.IsStockTypeId = true
this.IsDeptId = true
this.IsDeliveryMode = true
this.IsSettleMode = true
this.IsStockPersonId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '4') {
this.addsouce = false
this.addpro = false
this.IsStockPersonId = true
this.IsStockTypeId = true
this.IsDeptId = true
this.IsDeliveryMode = true
this.IsSettleMode = true
this.IsPayMode = true
this.IsSignPersonId = true
this.currency = true
this.IsSupplierId = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '5') { } else if (this.personalForm.sourceType === '5') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() this.IsStockPersonId = false
this.IsStockTypeId = false
this.IsDeptId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsPayMode = false
this.IsSignPersonId = false
this.currency = false
this.IsSupplierId = false
} }
}, },
// //
handleAddSouce() { handleAddSouce() {
console.log(this.personalForm.supplierId)
if (this.personalForm.sourceType === '1') { if (this.personalForm.sourceType === '1') {
this.applycontrol = true this.applycontrol = true
} else if (this.personalForm.sourceType === '2') { } else if (this.personalForm.sourceType === '2') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.plancontrol = true this.plancontrol = true
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.inquirycontrol = true this.inquirycontrol = true
} else if (this.personalForm.sourceType === '4') { } else if (this.personalForm.sourceType === '4') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.contractcontrol = true this.contractcontrol = true
} }
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
}, },
// //
contract(val) { contract(val) {
@ -539,8 +714,7 @@ export default {
} }
}, },
allcontractinfo(val) { allcontractinfo(val) {
this.personalForm.supplierId = val.supplierId console.log(val)
this.supplierId = val.supplierName
this.stockPersonId = val.stockPersonName this.stockPersonId = val.stockPersonName
this.personalForm.stockPersonId = val.stockPersonId this.personalForm.stockPersonId = val.stockPersonId
this.personalForm.stockType = val.stockType this.personalForm.stockType = val.stockType
@ -572,16 +746,15 @@ export default {
} }
}, },
allLnquirinfo(val) { allLnquirinfo(val) {
this.personalForm.supplierId = val.supplierId console.log(val)
this.supplierId = val.supplierName this.personalForm.stockTypeId = val.stockTypeId
this.personalForm.stockType = val.stockTypeId
this.personalForm.deptId = val.deptId this.personalForm.deptId = val.deptId
this.personalForm.isVat = val.isVat
searchsupplier(val.supplierName).then(res => { searchsupplier(val.supplierName).then(res => {
if (res.data.ret === 200) { if (res.data.ret === 200) {
console.log(res)
this.personalForm.deliveryMode = res.data.data.content.list[0].giveId this.personalForm.deliveryMode = res.data.data.content.list[0].giveId
this.personalForm.transferId = res.data.data.content.list[0].transportId this.personalForm.transferId = res.data.data.content.list[0].transportId
this.personalForm.settleId = res.data.data.content.list[0].paymentId this.personalForm.settleMode = res.data.data.content.list[0].paymentId
} }
this.getways() this.getways()
}) })
@ -606,13 +779,15 @@ export default {
} }
}, },
allapplyinfo(val) { allapplyinfo(val) {
this.personalForm.stockType = val.stockType console.log(val)
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.applyDeptId this.personalForm.deptId = val.applyDeptId
}, },
// //
plan(val) { plan(val) {
console.log(val) console.log(val)
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
const quchonggong = this.personalForm.supplierId
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) { if (val[i].productCode === nowlistdata[j].productCode) {
@ -624,13 +799,20 @@ export default {
return false return false
} }
} }
if (val[i].supplierId !== quchonggong) {
console.log(1234)
continue
}
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
allPlaninfo(val) { allPlaninfo(val) {
this.personalForm.stockType = val.stockType console.log(val)
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.stockDeptId this.personalForm.deptId = val.stockDeptId
this.personalForm.isVat = val.isVat this.personalForm.isVat = val.isVat
this.stockPersonId = val.stockPersonName
this.personalForm.stockPersonId = val.stockPersonId
}, },
// //
updatecountry() { updatecountry() {
@ -659,6 +841,8 @@ export default {
console.log(val) console.log(val)
this.supplierId = val.supplierName this.supplierId = val.supplierName
this.personalForm.supplierId = val.id this.personalForm.supplierId = val.id
this.supp = val.id
this.$refs.editable.clear()
}, },
// focus // focus
handlechooseStock() { handlechooseStock() {
@ -679,6 +863,14 @@ export default {
}, },
// //
handleAddproduct() { handleAddproduct() {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.control = true this.control = true
}, },
productdetail(val) { productdetail(val) {
@ -755,6 +947,9 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
@ -788,26 +983,30 @@ export default {
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
addstockorder(parms, parms2, this.personalForm).then(res => { this.$refs.editable.validate().then(valid => {
console.log(res) addstockorder(parms, parms2, this.personalForm).then(res => {
if (res.data.ret === 200) { console.log(res)
this.$notify({ if (res.data.ret === 200) {
title: '成功', this.$notify({
message: '保存成功', title: '成功',
type: 'success', message: '保存成功',
offset: 100 type: 'success',
}) offset: 100
this.restAllForm() })
this.$refs.editable.clear() this.restAllForm()
this.$refs.personalForm.clearValidate() this.$refs.editable.clear()
this.$refs.personalForm.resetFields() this.$refs.personalForm.clearValidate()
} else { this.$refs.personalForm.resetFields()
this.$notify.error({ } else {
title: '错误', this.$notify.error({
message: res.data.msg, title: '错误',
offset: 100 message: res.data.msg,
}) offset: 100
} })
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
} else { } else {
this.$notify.error({ this.$notify.error({

View file

@ -369,6 +369,9 @@ export default {
if (row.currency !== null) { if (row.currency !== null) {
this.personalForm.currency = String(row.currency) this.personalForm.currency = String(row.currency)
} }
if (row.payMode !== null) {
this.personalForm.payMode = String(row.payMode)
}
}, },
// //
refreshlist(val) { refreshlist(val) {

View file

@ -59,6 +59,11 @@
<span>{{ personalForm.currency | currencyFilter }}</span> <span>{{ personalForm.currency | currencyFilter }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('StockOrder.supplierNumber')" style="width: 100%;">
<span>{{ personalForm.supplierNumber }}</span>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
@ -87,24 +92,14 @@
<el-editable-column prop="price" align="center" label="单价" min-width="150px"/> <el-editable-column prop="price" align="center" label="单价" min-width="150px"/>
<el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="150px"/> <el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="150px"/>
<el-editable-column prop="taxRate" align="center" label="税率" min-width="150px"/> <el-editable-column prop="taxRate" align="center" label="税率" min-width="150px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"> <el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
<template slot-scope="scope"> <el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
<p>{{ getMoney(scope.row) }}</p> <el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
</template>
</el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="applicationReason" align="center" label="备注" min-width="150px"/> <el-editable-column prop="applicationReason" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
<el-editable-column prop="arrivalQuantity" align="center" label="已到货数量" min-width="150px"/>
<el-editable-column prop="returnQuantity" align="center" label="退货数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -257,21 +252,6 @@ export default {
} }
}, },
methods: { methods: {
//
getTaxMoney2(row) {
row.taxMoney = row.price * row.taxRate
return row.taxMoney
},
//
getTaxMoney(row) {
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice
return row.includeTaxMoney
},
//
getMoney(row) {
row.money = row.plannedQuantity * row.price
return row.money
},
handlecancel() { handlecancel() {
this.editVisible = false this.editVisible = false
} }

View file

@ -145,7 +145,7 @@
import { stocapplylist } from '@/api/StockApply' import { stocapplylist } from '@/api/StockApply'
import { getdeptlist } from '@/api/BasicSettings' import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory' import { searchStockCategory } from '@/api/StockCategory'
import { productlist } from '@/api/public' // import { productlist } from '@/api/public'
import waves from '@/directive/waves' // Waves directive import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import MyEmp from '../../StockApply/components/MyEmp' import MyEmp from '../../StockApply/components/MyEmp'
@ -339,23 +339,11 @@ export default {
price: '', price: '',
discountRate: 0, discountRate: 0,
discountMoney: 0, discountMoney: 0,
remark: 0, remark: '',
arrivalQuantity: 0 arrivalQuantity: '0.00',
includeTaxPrice: 0
} }
}) })
const list = await Promise.all(applydata.map(function(item) {
return productlist(item.productCode)
}))
for (let i = 0; i < applyDetail.length; i++) {
for (let j = 0; j < list.length; j++) {
if (applyDetail[i].productCode === list[j].data.data.content.list[0].code) {
applyDetail[i].price = list[j].data.data.content.list[0].purchasePrice
applyDetail[i].includeTaxPrice = list[j].data.data.content.list[0].purchasePrice
}
}
}
console.log(applydata[0].price) console.log(applydata[0].price)
this.$emit('apply', applyDetail) this.$emit('apply', applyDetail)
this.$emit('apply2', applyDetail) this.$emit('apply2', applyDetail)

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="employeeVisible" :contractcontrol="contractcontrol" :close-on-press-escape="false" top="10px" title="选择采购合同" append-to-body width="1100px" @close="$emit('update:contractcontrol', false)"> <el-dialog :visible.sync="employeeVisible" :contractcontrol="contractcontrol" :supp="supp" :close-on-press-escape="false" top="10px" title="选择采购合同" append-to-body width="1100px" @close="$emit('update:contractcontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never"> <el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row> <el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px"> <el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
@ -196,6 +196,10 @@ export default {
contractcontrol: { contractcontrol: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -247,6 +251,7 @@ export default {
pageSize: 10, pageSize: 10,
repositoryId: 438, repositoryId: 438,
regionIds: 2, regionIds: 2,
supplierId: this.supp,
createPersonId: 3 createPersonId: 3
}, },
// //
@ -260,11 +265,12 @@ export default {
watch: { watch: {
contractcontrol() { contractcontrol() {
this.employeeVisible = this.contractcontrol this.employeeVisible = this.contractcontrol
},
supp() {
this.getemplist.supplierId = this.supp
this.getlist()
} }
}, },
created() {
this.getlist()
},
methods: { methods: {
// //
updatecountry() { updatecountry() {
@ -367,7 +373,7 @@ export default {
discountMoney: item.discountMoney, discountMoney: item.discountMoney,
price: item.price, price: item.price,
includeTaxPrice: item.includeTaxPrice, includeTaxPrice: item.includeTaxPrice,
arrivalQuantity: 0, arrivalQuantity: '0.00',
taxRate: item.taxRate, taxRate: item.taxRate,
money: item.money, money: item.money,
includeTaxMoney: item.includeTaxMoney, includeTaxMoney: item.includeTaxMoney,

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="productVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择商品" append-to-body @close="$emit('update:control', false)"> <el-dialog :visible.sync="productVisible" :control="control" :supp="supp" :close-on-press-escape="false" top="10px" title="选择商品" append-to-body @close="$emit('update:control', false)">
<div class="filter-container"> <div class="filter-container">
<!-- 搜索条件栏目 --> <!-- 搜索条件栏目 -->
<el-input v-model="getemplist.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/> <el-input v-model="getemplist.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
@ -136,6 +136,10 @@ export default {
control: { control: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -173,6 +177,7 @@ export default {
typeid: '', typeid: '',
isactive: '', isactive: '',
Productid: '', Productid: '',
supplierid: this.supp,
pagenum: 1, pagenum: 1,
pagesize: 10 pagesize: 10
} }
@ -183,6 +188,11 @@ export default {
this.productVisible = this.control this.productVisible = this.control
console.log(this.control) console.log(this.control)
this.getlist() this.getlist()
},
supp() {
this.getemplist.supplierid = this.supp
this.getlist()
console.log(this.supp)
} }
}, },
created() { created() {

View file

@ -30,13 +30,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.stockPersonId')" prop="stockPersonId" style="width: 100%;"> <el-form-item :label="$t('StockOrder.stockPersonId')" prop="stockPersonId" style="width: 100%;">
<el-input v-model="stockPersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/> <el-input v-model="stockPersonId" :disabled="IsStockPersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.stockType')" prop="stockType" style="width: 100%;"> <el-form-item :label="$t('StockOrder.stockType')" prop="stockType" style="width: 100%;">
<el-select v-model="personalForm.stockTypeId" style="margin-left: 18px;width: 200px" @focus="updatecountry"> <el-select v-model="personalForm.stockTypeId" :disabled="IsStockTypeId" style="margin-left: 18px;width: 200px" @focus="updatecountry">
<el-option <el-option
v-for="(item, index) in types" v-for="(item, index) in types"
:key="index" :key="index"
@ -47,7 +47,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.deptId')" prop="deptId" style="width: 100%;"> <el-form-item :label="$t('StockOrder.deptId')" prop="deptId" style="width: 100%;">
<el-select v-model="personalForm.deptId" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.deptId" :disabled="IsDeptId" clearable style="margin-left: 18px;width: 200px">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -58,7 +58,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.payMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.payMode')" style="width: 100%;">
<el-select v-model="personalForm.payMode" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.payMode" :disabled="IsPayMode" clearable style="margin-left: 18px;width: 200px">
<el-option value="1" label="现金"/> <el-option value="1" label="现金"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -67,6 +67,7 @@
<el-form-item :label="$t('StockOrder.orderDate')" prop="signDate" style="width: 100%;"> <el-form-item :label="$t('StockOrder.orderDate')" prop="signDate" style="width: 100%;">
<el-date-picker <el-date-picker
v-model="personalForm.orderDate" v-model="personalForm.orderDate"
:picker-options="pickerOptions1"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/> style="margin-left: 18px;width: 200px"/>
@ -74,13 +75,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.signPersonId')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.signPersonId')" style="width: 100%;">
<el-input v-model="signPersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseDelivery"/> <el-input v-model="signPersonId" :disabled="IsSignPersonId" style="margin-left: 18px;width: 200px" clearable @focus="handlechooseDelivery"/>
</el-form-item> </el-form-item>
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/> <my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.deliveryMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.deliveryMode')" style="width: 100%;">
<el-select v-model="personalForm.deliveryMode" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.deliveryMode" :disabled="IsDeliveryMode" clearable style="margin-left: 18px;width: 200px">
<el-option <el-option
v-for="(item, index) in giveIds" v-for="(item, index) in giveIds"
:key="index" :key="index"
@ -92,7 +93,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.settleMode')" style="width: 100%;"> <el-form-item :label="$t('StockOrder.settleMode')" style="width: 100%;">
<el-select v-model="personalForm.settleMode" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.settleMode" :disabled="IsSettleMode" clearable style="margin-left: 18px;width: 200px">
<el-option <el-option
v-for="(item, index) in paymentIds" v-for="(item, index) in paymentIds"
:key="index" :key="index"
@ -112,12 +113,17 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockOrder.currency')" prop="currency" style="width: 100%;"> <el-form-item :label="$t('StockOrder.currency')" prop="currency" style="width: 100%;">
<el-select v-model="personalForm.currency" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.currency" :disabled="IsCurrency" clearable style="margin-left: 18px;width: 200px">
<el-option value="1" label="RMB"/> <el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/> <el-option value="2" label="USD"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('StockOrder.supplierNumber')" style="width: 100%;">
<el-input v-model="personalForm.supplierNumber" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
@ -127,12 +133,12 @@
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购询价单明细</h2> <h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">采购询价单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;"> <div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/> <my-detail :control.sync="control" :supp.sync="supp" @product="productdetail"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
<my-plan :plancontrol.sync="plancontrol" @plan="plan" @allPlaninfo="allPlaninfo"/> <my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allPlaninfo="allPlaninfo"/>
<my-lnquiry :inquirycontrol.sync="inquirycontrol" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/> <my-lnquiry :inquirycontrol.sync="inquirycontrol" :supp.sync="supp" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
<my-contract :contractcontrol.sync="contractcontrol" @contract="contract" @allcontractinfo="allcontractinfo"/> <my-contract :contractcontrol.sync="contractcontrol" :supp.sync="supp" @contract="contract" @allcontractinfo="allcontractinfo"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button> <el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div> </div>
<div class="container"> <div class="container">
@ -154,10 +160,11 @@
<el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/> <el-editable-column prop="productName" align="center" label="物品名称" min-width="150px"/>
<el-editable-column prop="productType" align="center" label="规格" min-width="150px"/> <el-editable-column prop="productType" align="center" label="规格" min-width="150px"/>
<el-editable-column prop="unit" align="center" label="单位" min-width="150px"/> <el-editable-column prop="unit" align="center" label="单位" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="stockQuantity" align="center" label="采购数量" min-width="150px"/> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="stockQuantity" align="center" label="采购数量" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.price" v-model="scope.row.price"
@input="getprice(scope.row)"/> @input="getprice(scope.row)"/>
</template> </template>
@ -165,6 +172,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" align="center" label="含税价" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.includeTaxPrice" v-model="scope.row.includeTaxPrice"
@input="getincludeTaxPrice(scope.row)"/> @input="getincludeTaxPrice(scope.row)"/>
</template> </template>
@ -172,6 +180,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="taxRate" align="center" label="税率(%)" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.taxRate" v-model="scope.row.taxRate"
@input="gettaxRate(scope.row)"/> @input="gettaxRate(scope.row)"/>
</template> </template>
@ -195,6 +204,7 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountRate" align="center" label="折扣率(%)" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountRate" align="center" label="折扣率(%)" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.discountRate" v-model="scope.row.discountRate"
@input="getdiscountRate(scope.row)"/> @input="getdiscountRate(scope.row)"/>
</template> </template>
@ -202,13 +212,14 @@
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountMoney" align="center" label="折扣额" min-width="170px"> <el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input-number <el-input-number
:precision="2"
v-model="scope.row.discountMoney" v-model="scope.row.discountMoney"
@input="getdiscountMoney(scope.row)"/> @input="getdiscountMoney(scope.row)"/>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="remarks" align="center" label="备注" min-width="150px"/> <el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="stockQuantity" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
<el-editable-column prop="arrivalQuantity" align="center" label="已到货数量" min-width="150px"/> <el-editable-column prop="arrivalQuantity" align="center" label="已到货数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
@ -220,36 +231,36 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采购数量合计" style="width: 100%;"> <el-form-item label="采购数量合计" style="width: 100%;">
<el-input v-model="allNumber" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allQuantity" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="金额合计" style="width: 100%;"> <el-form-item label="金额合计" style="width: 100%;">
<el-input v-model="allMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="税额合计" style="width: 100%;"> <el-form-item label="税额合计" style="width: 100%;">
<el-input v-model="allTaxMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allTaxMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="含税金额合计" style="width: 100%;"> <el-form-item label="含税金额合计" style="width: 100%;">
<el-input v-model="allIncludeTaxMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allIncludeTaxMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="整单折扣金额合计" style="width: 100%;"> <el-form-item label="整单折扣金额合计" style="width: 100%;">
<el-input v-model="allDiscountMoney" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allDiscountMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="折后含税金额合计" style="width: 100%;"> <el-form-item label="折后含税金额合计" style="width: 100%;">
<el-input v-model="allMoneyMoveDiscount" style="margin-left: 18px;width: 200px" disabled/> <el-input v-model="personalForm.allIncludeTaxDiscountMoney" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="折后含税金额合计" style="width: 100%;"> <el-form-item label="其他费用支出合计" style="width: 100%;">
<el-input v-model="personalForm.otherMoney" style="margin-left: 18px;width: 200px"/> <el-input v-model="personalForm.otherMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -294,14 +305,63 @@ export default {
}, },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.supplierId)
if (value === '') { if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
callback(new Error('请选择')) callback(new Error('请选择供应商'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.signPersonId)
if (this.signPersonId === undefined || this.signPersonId === null || this.signPersonId === '') {
callback(new Error('请选择签约人'))
} else {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.stockPersonId)
if (this.stockPersonId === undefined || this.stockPersonId === null || this.stockPersonId === '') {
callback(new Error('请选择采购员'))
} else {
callback()
}
}
const validatePass4 = (rule, value, callback) => {
console.log(this.personalForm.deptId)
if (this.personalForm.deptId === undefined || this.personalForm.deptId === null || this.personalForm.deptId === '') {
callback(new Error('请选择部门'))
} else { } else {
callback() callback()
} }
} }
return { return {
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
}
},
//
supp: null,
//
IsCurrency: false,
//
IsSignPersonId: false,
//
IsPayMode: false,
//
IsSettleMode: false,
//
IsDeliveryMode: false,
//
IsSupplierId: false,
//
IsStockPersonId: false,
//
IsStockTypeId: false,
//
IsDeptId: false,
// //
choosedata: [], choosedata: [],
// //
@ -359,17 +419,20 @@ export default {
control: false, control: false,
// //
personalrules: { personalrules: {
signPersonId: [
{ required: true, validator: validatePass2, trigger: 'change' }
],
stockPersonId: [
{ required: true, validator: validatePass3, trigger: 'change' }
],
supplierId: [ supplierId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
inquiryPersonId: [ orderDate: [
{ required: true, validator: validatePass, trigger: 'focus' }
],
inquiryDate: [
{ required: true, message: '请选择询价日期', trigger: 'change' } { required: true, message: '请选择询价日期', trigger: 'change' }
], ],
deptId: [ deptId: [
{ required: true, message: '请选择部门', trigger: 'change' } { required: true, validator: validatePass4, trigger: 'change' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
@ -382,6 +445,9 @@ export default {
list2: [], list2: [],
// //
validRules: { validRules: {
name: [
{ required: true, message: '请输入名称', trigger: 'change' }
]
} }
} }
}, },
@ -403,6 +469,10 @@ export default {
this.getways() this.getways()
}, },
methods: { methods: {
//
change() {
this.$forceUpdate()
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -417,9 +487,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return (Number(prev) + Number(curr)).toFixed(2)
} else { } else {
return (prev).toFixed(2) return (Number(prev)).toFixed(2)
} }
}, 0) }, 0)
sums[index] += '' sums[index] += ''
@ -431,21 +501,21 @@ export default {
sums[3] = '' sums[3] = ''
sums[4] = '' sums[4] = ''
sums[5] = '' sums[5] = ''
sums[6] = '' sums[7] = ''
sums[8] = '' sums[8] = ''
sums[9] = '' sums[9] = ''
sums[10] = '' sums[13] = ''
sums[14] = '' sums[14] = ''
sums[15] = '' sums[16] = ''
sums[17] = '' sums[17] = ''
sums[18] = '' sums[18] = ''
sums[19] = '' sums[19] = ''
this.allNumber = sums[7] this.allNumber = sums[6]
this.allMoney = sums[11] this.allMoney = sums[10]
this.allTaxMoney = sums[13] this.allTaxMoney = sums[12]
this.allIncludeTaxMoney = sums[12] this.allIncludeTaxMoney = sums[11]
this.allDiscountMoney = sums[16] this.allDiscountMoney = sums[15]
this.allMoneyMoveDiscount = sums[12] - sums[16] this.allMoneyMoveDiscount = sums[11] - sums[15]
return sums return sums
}, },
getways() { getways() {
@ -485,57 +555,152 @@ export default {
}, },
// //
gettaxRate(row) { gettaxRate(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2) if (row.includeTaxPrice !== 0) {
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}
}, },
// //
getincludeTaxPrice(row) { getincludeTaxPrice(row) {
if (row.price !== 0) { if (row.price !== 0) {
row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2) row.taxRate = ((row.includeTaxPrice / row.price - 1) * 100).toFixed(2)
console.log(row.taxRate)
} }
}, },
// //
getprice(row) { getprice(row) {
row.includeTaxPrice = (row.price * (1 + row.taxRate)).toFixed(2) row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
}, },
// //
getTaxMoney2(row) { getTaxMoney2(row) {
row.tax = (row.price * row.taxRate * row.stockQuantity).toFixed(2) row.tax = (row.price * row.taxRate / 100 * row.stockQuantity).toFixed(2)
return row.tax return row.tax
}, },
// //
getTaxMoney(row) { getTaxMoney(row) {
row.includeTaxMoney = row.stockQuantity * row.includeTaxPrice row.includeTaxMoney = (row.stockQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney return row.includeTaxMoney
}, },
// //
getMoney(row) { getMoney(row) {
row.money = row.stockQuantity * row.price row.money = (row.stockQuantity * row.price).toFixed(2)
return row.money return row.money
}, },
// //
chooseType() { chooseType() {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4') { if (this.personalForm.sourceType === '1') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() this.IsStockTypeId = true
this.IsDeptId = true
this.IsSupplierId = false
this.IsStockPersonId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '2') {
this.addsouce = false
this.addpro = false
this.IsStockTypeId = true
this.IsDeptId = true
this.IsStockPersonId = true
this.IsSupplierId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '3') {
this.addsouce = false
this.addpro = false
this.IsSupplierId = true
this.IsStockTypeId = true
this.IsDeptId = true
this.IsDeliveryMode = true
this.IsSettleMode = true
this.IsStockPersonId = false
this.IsPayMode = false
this.IsSignPersonId = false
this.IsCurrency = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '4') {
this.addsouce = false
this.addpro = false
this.IsStockPersonId = true
this.IsStockTypeId = true
this.IsDeptId = true
this.IsDeliveryMode = true
this.IsSettleMode = true
this.IsPayMode = true
this.IsSignPersonId = true
this.currency = true
this.IsSupplierId = false
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
} else if (this.personalForm.sourceType === '5') { } else if (this.personalForm.sourceType === '5') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() this.IsStockPersonId = false
this.IsStockTypeId = false
this.IsDeptId = false
this.IsDeliveryMode = false
this.IsSettleMode = false
this.IsPayMode = false
this.IsSignPersonId = false
this.currency = false
this.IsSupplierId = false
} }
}, },
// //
handleAddSouce() { handleAddSouce() {
console.log(this.personalForm.supplierId)
if (this.personalForm.sourceType === '1') { if (this.personalForm.sourceType === '1') {
this.applycontrol = true this.applycontrol = true
} else if (this.personalForm.sourceType === '2') { } else if (this.personalForm.sourceType === '2') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.plancontrol = true this.plancontrol = true
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.inquirycontrol = true this.inquirycontrol = true
} else if (this.personalForm.sourceType === '4') { } else if (this.personalForm.sourceType === '4') {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.contractcontrol = true this.contractcontrol = true
} }
if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable.clear()
}
}, },
// //
contract(val) { contract(val) {
@ -589,16 +754,15 @@ export default {
} }
}, },
allLnquirinfo(val) { allLnquirinfo(val) {
this.personalForm.supplierId = val.supplierId console.log(val)
this.supplierId = val.supplierName this.personalForm.stockTypeId = val.stockTypeId
this.personalForm.stockType = val.stockTypeId
this.personalForm.deptId = val.deptId this.personalForm.deptId = val.deptId
this.personalForm.isVat = val.isVat
searchsupplier(val.supplierName).then(res => { searchsupplier(val.supplierName).then(res => {
if (res.data.ret === 200) { if (res.data.ret === 200) {
console.log(res)
this.personalForm.deliveryMode = res.data.data.content.list[0].giveId this.personalForm.deliveryMode = res.data.data.content.list[0].giveId
this.personalForm.transferId = res.data.data.content.list[0].transportId this.personalForm.transferId = res.data.data.content.list[0].transportId
this.personalForm.settleId = res.data.data.content.list[0].paymentId this.personalForm.settleMode = res.data.data.content.list[0].paymentId
} }
this.getways() this.getways()
}) })
@ -623,13 +787,15 @@ export default {
} }
}, },
allapplyinfo(val) { allapplyinfo(val) {
this.personalForm.stockType = val.stockType console.log(val)
this.personalForm.stockTypeId = val.stockType
this.personalForm.deptId = val.applyDeptId this.personalForm.deptId = val.applyDeptId
}, },
// //
plan(val) { plan(val) {
console.log(val) console.log(val)
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
const quchonggong = this.personalForm.supplierId
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) { if (val[i].productCode === nowlistdata[j].productCode) {
@ -641,13 +807,21 @@ export default {
return false return false
} }
} }
if (val[i].supplierId !== quchonggong) {
console.log(1234)
continue
}
this.$refs.editable.insert(val[i]) this.$refs.editable.insert(val[i])
} }
}, },
allPlaninfo(val) { allPlaninfo(val) {
console.log(val)
this.personalForm.stockTypeId = val.stockType
this.personalForm.stockType = val.stockType this.personalForm.stockType = val.stockType
this.personalForm.deptId = val.stockDeptId this.personalForm.deptId = val.stockDeptId
this.personalForm.isVat = val.isVat this.personalForm.isVat = val.isVat
this.stockPersonId = val.stockPersonName
this.personalForm.stockPersonId = val.stockPersonId
}, },
// //
updatecountry() { updatecountry() {
@ -676,6 +850,8 @@ export default {
console.log(val) console.log(val)
this.supplierId = val.supplierName this.supplierId = val.supplierName
this.personalForm.supplierId = val.id this.personalForm.supplierId = val.id
this.supp = val.id
this.$refs.editable.clear()
}, },
// focus // focus
handlechooseStock() { handlechooseStock() {
@ -696,6 +872,14 @@ export default {
}, },
// //
handleAddproduct() { handleAddproduct() {
if (this.personalForm.supplierId === null || this.personalForm.supplierId === undefined || this.personalForm.supplierId === '') {
this.$notify.error({
title: '错误',
message: '请先选择供应商',
duration: 0
})
return false
}
this.control = true this.control = true
}, },
productdetail(val) { productdetail(val) {
@ -778,6 +962,9 @@ export default {
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) { if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
@ -809,26 +996,41 @@ export default {
} }
} }
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
updatestockorder(parms, parms2).then(res => { this.$refs.personalForm.validate((valid) => {
if (res.data.ret === 200) { if (valid) {
this.$notify({ this.$refs.editable.validate().then(valid => {
title: '操作成功', updatestockorder(parms, parms2).then(res => {
message: '操作成功', if (res.data.ret === 200) {
type: 'success', this.$notify({
duration: 1000, title: '操作成功',
offset: 100 message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else { } else {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
message: '出错了', message: '信息未填完整',
offset: 100 offset: 100
}) })
return false
} }
}) })
}, },

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="employeeVisible" :inquirycontrol="inquirycontrol" :close-on-press-escape="false" top="10px" title="选择采购询价单" append-to-body width="1100px" @close="$emit('update:inquirycontrol', false)"> <el-dialog :visible.sync="employeeVisible" :inquirycontrol="inquirycontrol" :supp="supp" :close-on-press-escape="false" top="10px" title="选择采购询价单" append-to-body width="1100px" @close="$emit('update:inquirycontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never"> <el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row> <el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px"> <el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
@ -199,6 +199,10 @@ export default {
inquirycontrol: { inquirycontrol: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -250,6 +254,7 @@ export default {
pageSize: 10, pageSize: 10,
repositoryId: 438, repositoryId: 438,
regionIds: 2, regionIds: 2,
supplierId: this.supp,
createPersonId: 3, createPersonId: 3,
judgeStat: '' judgeStat: ''
}, },
@ -265,6 +270,11 @@ export default {
inquirycontrol() { inquirycontrol() {
this.employeeVisible = this.inquirycontrol this.employeeVisible = this.inquirycontrol
this.getlist() this.getlist()
},
supp() {
this.getemplist.supplierId = this.supp
this.getlist()
console.log(this.supp)
} }
}, },
created() { created() {
@ -372,7 +382,7 @@ export default {
remark: 0, remark: 0,
discountRate: 0, discountRate: 0,
discountMoney: 0, discountMoney: 0,
arrivalQuantity: 0, arrivalQuantity: '0.00',
price: item.price, price: item.price,
includeTaxPrice: item.includeTaxPrice, includeTaxPrice: item.includeTaxPrice,
taxRate: item.taxRate, taxRate: item.taxRate,

View file

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="employeeVisible" :plancontrol="plancontrol" :close-on-press-escape="false" top="10px" title="选择采购计划单" append-to-body width="1100px" @close="$emit('update:plancontrol', false)"> <el-dialog :visible.sync="employeeVisible" :plancontrol="plancontrol" :supp="supp" :close-on-press-escape="false" top="10px" title="选择采购计划单" append-to-body width="1100px" @close="$emit('update:plancontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never"> <el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row> <el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px"> <el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
@ -181,6 +181,10 @@ export default {
plancontrol: { plancontrol: {
type: Boolean, type: Boolean,
default: false default: false
},
supp: {
type: Number,
default: null
} }
}, },
data() { data() {
@ -227,6 +231,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
repositoryId: 438, repositoryId: 438,
supplierId: this.supp,
regionIds: 2, regionIds: 2,
createPersonId: 3 createPersonId: 3
}, },
@ -241,6 +246,11 @@ export default {
watch: { watch: {
plancontrol() { plancontrol() {
this.employeeVisible = this.plancontrol this.employeeVisible = this.plancontrol
},
supp() {
this.getemplist.supplierId = this.supp
this.getlist()
console.log(this.supp)
} }
}, },
created() { created() {
@ -334,9 +344,10 @@ export default {
remark: 0, remark: 0,
discountRate: 0, discountRate: 0,
discountMoney: 0, discountMoney: 0,
arrivalQuantity: 0, arrivalQuantity: '0.00',
price: item.basicPrice, price: item.basicPrice,
includeTaxPrice: item.basicPrice includeTaxPrice: item.basicPrice,
supplierId: item.supplierId
} }
}) })
console.log(applyDetail) console.log(applyDetail)

View file

@ -25,19 +25,19 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockPlan.planPersonId')" prop="planPersonId" style="width: 100%;"> <el-form-item :label="$t('StockPlan.planPersonId')" prop="planPersonId" style="width: 100%;">
<el-input v-model="planPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/> <el-input v-model="planPersonId" style="margin-left: 18px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/> <my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockPlan.stockPersonId')" prop="stockPersonId" style="width: 100%;"> <el-form-item :label="$t('StockPlan.stockPersonId')" prop="stockPersonId" style="width: 100%;">
<el-input v-model="stockPersonId" style="margin-left: 18px" clearable @focus="handlechooseDelivery"/> <el-input v-model="stockPersonId" style="margin-left: 18px" @focus="handlechooseDelivery"/>
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/> <my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockPlan.stockDeptId')" prop="stockDeptId" style="width: 100%;"> <el-form-item :label="$t('StockPlan.stockDeptId')" prop="stockDeptId" style="width: 100%;">
<el-select v-model="personalForm.stockDeptId" clearable style="margin-left: 18px;width: 218px"> <el-select v-model="personalForm.stockDeptId" style="margin-left: 18px;width: 218px" @change="change()">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -59,6 +59,7 @@
<el-form-item :label="$t('StockPlan.planDate')" prop="planDate" style="width: 100%;"> <el-form-item :label="$t('StockPlan.planDate')" prop="planDate" style="width: 100%;">
<el-date-picker <el-date-picker
v-model="personalForm.planDate" v-model="personalForm.planDate"
:picker-options="pickerOptions1"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="margin-left: 18px"/> style="margin-left: 18px"/>
@ -75,7 +76,7 @@
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/> <my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @apply2="apply2"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @apply2="apply2" @allinfo="allinfo"/>
<my-require :requirecontrol.sync="requirecontrol" @require="requiredata" @require2="requiredata2"/> <my-require :requirecontrol.sync="requirecontrol" @require="requiredata" @require2="requiredata2"/>
<el-button type="danger" @click="deleteEdit">删除</el-button> <el-button type="danger" @click="deleteEdit">删除</el-button>
</div> </div>
@ -103,7 +104,9 @@
<p>{{ basicPrice(scope.row) }}</p> <p>{{ basicPrice(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible' ,events: {change: changeDate}}" prop="planQuantity" align="center" label="计划数量" min-width="150px"/> <el-editable-column prop="requireQuantity" align="center" label="需求数量" min-width="150px"/>
<el-editable-column prop="requireDate" align="center" label="需求日期" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible' ,events: {change: changeDate}}" prop="planQuantity" align="center" label="计划数量" min-width="150px"/>
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px"> <el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ planMoney(scope.row) }}</p> <p>{{ planMoney(scope.row) }}</p>
@ -114,10 +117,11 @@
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="supplierName" align="center" label="供应商" min-width="150px"> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="supplierName" align="center" label="供应商" min-width="150px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input v-model="scope.row.supplierName" :value="scope.row.supplierName" @focus="handlechoose"/> <el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
<my-supplier :control.sync="empcontrol" @supplierName="personName(scope, $event)"/> <my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -147,16 +151,17 @@
<p>{{ basicPrice(scope.row) }}</p> <p>{{ basicPrice(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px"/> <el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px">
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ planMoney(scope.row) }}</p> <p>{{ planQuantity(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'default'}" prop="planDeliveryDate" align="center" label="计划交货日期" min-width="170px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'default'}" prop="planDeliveryDate" align="center" label="计划交货日期" min-width="170px"/>
<el-editable-column prop="applyReason" align="center" label="申请原因" min-width="150px"/> <el-editable-column prop="applyReason" align="center" label="申请原因" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="supplierName" align="center" label="供应商" min-width="150px"/> <el-editable-column prop="supplierName" align="center" label="供应商" min-width="150px"/>
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -167,12 +172,12 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockPlan.heji1')" style="width: 100%;"> <el-form-item :label="$t('StockPlan.heji1')" style="width: 100%;">
<el-input v-model="heji1" style="margin-left: 18px" disabled/> <el-input v-model="personalForm.allMoney" style="margin-left: 18px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('StockPlan.heji2')" style="width: 100%;"> <el-form-item :label="$t('StockPlan.heji2')" style="width: 100%;">
<el-input v-model="heji2" style="margin-left: 18px" disabled/> <el-input v-model="personalForm.totalQuantity" style="margin-left: 18px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -191,27 +196,52 @@
<script> <script>
import { addstockplan } from '@/api/StockPlan' import { addstockplan } from '@/api/StockPlan'
import { getdeptlist } from '@/api/BasicSettings' import { getdeptlist } from '@/api/BasicSettings'
import { productlist } from '@/api/public' // import { productlist } from '@/api/public'
import { searchStockCategory } from '@/api/StockCategory' import { searchStockCategory } from '@/api/StockCategory'
import MyEmp from './components/MyEmp' import MyEmp from './components/MyEmp'
import MyDelivery from '../DailyAdjust/components/MyDelivery' import MyDelivery from '../DailyAdjust/components/MyDelivery'
import MyDetail from './components/MyDetail' import MyDetail from './components/MyDetail'
import MyApply from './components/MyApply' import MyApply from './components/MyApply'
import MySupplier from '../Product/components/MySupplier' import MySupplier from './components/MySupplier'
import MyRequire from './components/MyRequire' import MyRequire from './components/MyRequire'
export default { export default {
name: 'AddStockPlan', name: 'AddStockPlan',
components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp }, components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.planPersonId)
if (value === '') { if (this.planPersonId === undefined || this.planPersonId === null || this.planPersonId === '') {
callback(new Error('请选择')) callback(new Error('请选择计划员'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.stockPersonId)
if (this.stockPersonId === undefined || this.stockPersonId === null || this.stockPersonId === '') {
callback(new Error('请选择采购员'))
} else {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.personalForm.stockDeptId)
if (this.personalForm.stockDeptId === undefined || this.personalForm.stockDeptId === null || this.personalForm.stockDeptId === '') {
callback(new Error('请选择采购部门'))
} else { } else {
callback() callback()
} }
} }
return { return {
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
}
},
// code
procode: null,
// scope
kongscope: '',
// //
heji1: '', heji1: '',
heji2: '', heji2: '',
@ -251,7 +281,8 @@ export default {
createPersonId: 3, createPersonId: 3,
countryId: 1, countryId: 1,
repositoryId: 438, repositoryId: 438,
regionId: 2 regionId: 2,
sourceType: '3'
}, },
// //
personalrules: { personalrules: {
@ -262,16 +293,16 @@ export default {
{ required: true, message: '请选择计划日期', trigger: 'change' } { required: true, message: '请选择计划日期', trigger: 'change' }
], ],
stockDeptId: [ stockDeptId: [
{ required: true, message: '请选择采购部门', trigger: 'change' } { required: true, validator: validatePass3, trigger: 'change' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
], ],
planPersonId: [ planPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
stockPersonId: [ stockPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass2, trigger: 'change' }
] ]
}, },
// //
@ -280,18 +311,40 @@ export default {
list3: [], list3: [],
// //
validRules: { validRules: {
supplierName: [
{ required: true, message: '请选择供应商', trigger: 'none' }
],
planQuantity: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
]
} }
} }
}, },
created() { created() {
this.getTypes() this.getTypes()
this.getdatatime()
this.chooseType()
}, },
methods: { methods: {
planQuantity(row) {
return (row.planQuantity).toFixed(2)
},
//
change() {
this.$forceUpdate()
},
getdatatime() { //
this.personalForm.planDate = new Date()
},
// //
planMoney(row) { planMoney(row) {
row.planMoney = row.basicPrice * row.planQuantity row.planMoney = (row.basicPrice * row.planQuantity).toFixed(2)
return row.planMoney return row.planMoney
}, },
//
basicPrice(row) {
return (row.basicPrice).toFixed(2)
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -306,9 +359,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return (Number(prev) + Number(curr)).toFixed(2)
} else { } else {
return prev return (Number(prev)).toFixed(2)
} }
}, 0) }, 0)
sums[index] += '' sums[index] += ''
@ -329,15 +382,6 @@ export default {
sums[12] = '' sums[12] = ''
return sums return sums
}, },
//
basicPrice(row) {
productlist(row.productCode).then(res => {
if (res.data.ret === 200) {
row.basicPrice = res.data.data.content.list[0].purchasePrice
}
})
return row.basicPrice
},
// //
changeDate(scope, value) { changeDate(scope, value) {
this.$refs.editable2.clear() this.$refs.editable2.clear()
@ -347,19 +391,26 @@ export default {
} }
}, },
// focus // focus
handlechoose() { handlechoose(scope) {
this.empcontrol = true this.empcontrol = true
this.kongscope = scope
this.procode = scope.row.productCode
}, },
// //
personName(scope, val) { personName(scope, val) {
scope.row.supplierName = val.supplierName console.log(scope)
scope.row.supplierId = val.id console.log(val)
// scope.row.supplierName = val.supplierName
// scope.row.supplierId = val.id
this.kongscope.row.supplierName = val.supplierName
this.kongscope.row.supplierId = val.id
this.$refs.editable2.clear() this.$refs.editable2.clear()
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
console.log(nowlistdata) console.log(nowlistdata)
for (let i = 0; i < nowlistdata.length; i++) { for (let i = 0; i < nowlistdata.length; i++) {
this.$refs.editable2.insert(nowlistdata[i]) this.$refs.editable2.insert(nowlistdata[i])
} }
return
}, },
// //
@ -367,14 +418,22 @@ export default {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') { if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable2.clear() this.$refs.editable.clear()
}
if (this.$refs.editable2.getRecords().length !== 0) {
this.$refs.editable2.clear()
}
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable2.clear() this.$refs.editable.clear()
}
if (this.$refs.editable2.getRecords().length !== 0) {
this.$refs.editable2.clear()
}
} }
}, },
// //
@ -423,8 +482,11 @@ export default {
this.requirecontrol = true this.requirecontrol = true
} }
}, },
apply(val) { allinfo(val) {
console.log(val) console.log(val)
this.personalForm.planDate = val.applyDate
},
apply(val) {
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
@ -542,6 +604,7 @@ export default {
deliveryName(val) { deliveryName(val) {
this.stockPersonId = val.personName this.stockPersonId = val.personName
this.personalForm.stockPersonId = val.id this.personalForm.stockPersonId = val.id
this.personalForm.stockDeptId = val.deptId
}, },
// //
restAllForm() { restAllForm() {
@ -620,27 +683,31 @@ export default {
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
addstockplan(parms, parms2, this.personalForm).then(res => { this.$refs.editable.validate().then(valid => {
console.log(res) addstockplan(parms, parms2, this.personalForm).then(res => {
if (res.data.ret === 200) { console.log(res)
this.$notify({ if (res.data.ret === 200) {
title: '成功', this.$notify({
message: '保存成功', title: '成功',
type: 'success', message: '保存成功',
offset: 100 type: 'success',
}) offset: 100
this.restAllForm() })
this.$refs.editable.clear() this.restAllForm()
this.$refs.editable2.clear() this.$refs.editable.clear()
this.$refs.personalForm.clearValidate() this.$refs.editable2.clear()
this.$refs.personalForm.resetFields() this.$refs.personalForm.clearValidate()
} else { this.$refs.personalForm.resetFields()
this.$notify.error({ } else {
title: '错误', this.$notify.error({
message: res.data.msg, title: '错误',
offset: 100 message: res.data.msg,
}) offset: 100
} })
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
} else { } else {
this.$notify.error({ this.$notify.error({

View file

@ -332,11 +332,14 @@ export default {
color: item.color, color: item.color,
basicQuantity: item.applyQuantity, basicQuantity: item.applyQuantity,
planDeliveryDate: item.requireDate, planDeliveryDate: item.requireDate,
planQuantity: item.applyQuantity,
applyReason: item.applyReason, applyReason: item.applyReason,
sourceNumber: number, sourceNumber: number,
supplierId: '', supplierId: '',
supplierName: '', supplierName: '',
basicPrice: '' basicPrice: 0,
planMoney: '0.00',
orderQuantity: '0.00'
} }
}) })
this.$emit('apply', applyDetail) this.$emit('apply', applyDetail)

View file

@ -267,13 +267,16 @@ export default {
color: item.color, color: item.color,
unit: item.purMeasu, unit: item.purMeasu,
productType: item.productType, productType: item.productType,
basicQuantity: 0, basicQuantity: '1.00',
planDeliveryDate: '', planDeliveryDate: '',
applyReason: '', applyReason: '',
sourceNumber: '', sourceNumber: '',
supplierId: item.supplierId, supplierId: item.supplierId,
supplierName: item.supplierName, supplierName: item.supplierName,
basicPrice: '' basicPrice: 0,
planMoney: '0.00',
planQuantity: 1,
orderQuantity: '0.00'
} }
}) })
console.log(productDetail) console.log(productDetail)

View file

@ -36,7 +36,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('StockPlan.stockDeptId')" prop="stockDeptId" style="width: 100%;"> <el-form-item :label="$t('StockPlan.stockDeptId')" prop="stockDeptId" style="width: 100%;">
<el-select v-model="personalForm.stockDeptId" clearable style="margin-left: 18px;width: 200px"> <el-select v-model="personalForm.stockDeptId" clearable style="margin-left: 18px;width: 200px" @change="change()">
<el-option <el-option
v-for="(item, index) in depts" v-for="(item, index) in depts"
:key="index" :key="index"
@ -74,7 +74,7 @@
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button> <el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/> <my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
<el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button> <el-button :disabled="addsouce" style="width: 130px" @click="handleAddSouce">从源单中选择</el-button>
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @apply2="apply2"/> <my-apply :applycontrol.sync="applycontrol" @apply="apply" @apply2="apply2" @allinfo="allinfo"/>
<my-require :requirecontrol.sync="requirecontrol" @require="requiredata" @require2="requiredata2"/> <my-require :requirecontrol.sync="requirecontrol" @require="requiredata" @require2="requiredata2"/>
<el-button type="danger" @click="deleteEdit">删除</el-button> <el-button type="danger" @click="deleteEdit">删除</el-button>
</div> </div>
@ -102,7 +102,9 @@
<p>{{ basicPrice(scope.row) }}</p> <p>{{ basicPrice(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible' ,events: {change: changeDate}}" prop="planQuantity" align="center" label="计划数量" min-width="150px"/> <el-editable-column prop="requireQuantity" align="center" label="需求数量" min-width="150px"/>
<el-editable-column prop="requireDate" align="center" label="需求日期" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible' ,events: {change: changeDate}}" prop="planQuantity" align="center" label="计划数量" min-width="150px"/>
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px"> <el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ planMoney(scope.row) }}</p> <p>{{ planMoney(scope.row) }}</p>
@ -113,10 +115,11 @@
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="supplierName" align="center" label="供应商" min-width="150px"> <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" prop="supplierName" align="center" label="供应商" min-width="150px">
<template slot="edit" slot-scope="scope"> <template slot="edit" slot-scope="scope">
<el-input v-model="scope.row.supplierName" :value="scope.row.supplierName" @focus="handlechoose"/> <el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
<my-supplier :control.sync="empcontrol" @supplierName="personName(scope, $event)"/> <my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
@ -146,20 +149,21 @@
<p>{{ basicPrice(scope.row) }}</p> <p>{{ basicPrice(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px"/> <el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px">
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ planMoney(scope.row) }}</p> <p>{{ planQuantity(scope.row) }}</p>
</template> </template>
</el-editable-column> </el-editable-column>
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'default'}" prop="planDeliveryDate" align="center" label="计划交货日期" min-width="170px"/> <el-editable-column :edit-render="{name: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'default'}" prop="planDeliveryDate" align="center" label="计划交货日期" min-width="170px"/>
<el-editable-column prop="applyReason" align="center" label="申请原因" min-width="150px"/> <el-editable-column prop="applyReason" align="center" label="申请原因" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="supplierName" align="center" label="供应商" min-width="150px"/> <el-editable-column prop="supplierName" align="center" label="供应商" min-width="150px"/>
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
</el-editable> </el-editable>
</div> </div>
</el-card> </el-card>
<el-card class="box-card" shadow="never"> <el-card class="box-card" style="margin-bottom: 30px" shadow="never">
<h2 ref="geren" class="form-name">合计信息</h2> <h2 ref="geren" class="form-name">合计信息</h2>
<div class="container" style="margin-top: 37px"> <div class="container" style="margin-top: 37px">
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px"> <el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
@ -190,13 +194,13 @@
<script> <script>
import { updatestockplan } from '@/api/StockPlan' import { updatestockplan } from '@/api/StockPlan'
import { getdeptlist } from '@/api/BasicSettings' import { getdeptlist } from '@/api/BasicSettings'
import { productlist } from '@/api/public' // import { productlist } from '@/api/public'
import { searchStockCategory } from '@/api/StockCategory' import { searchStockCategory } from '@/api/StockCategory'
import MyEmp from './MyEmp' import MyEmp from './MyEmp'
import MyDelivery from '../../DailyAdjust/components/MyDelivery' import MyDelivery from '../../DailyAdjust/components/MyDelivery'
import MyDetail from './MyDetail' import MyDetail from './MyDetail'
import MyApply from './MyApply' import MyApply from './MyApply'
import MySupplier from '../../Product/components/MySupplier' import MySupplier from './MySupplier'
import MyRequire from './MyRequire' import MyRequire from './MyRequire'
export default { export default {
components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp }, components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
@ -212,14 +216,39 @@ export default {
}, },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(this.planPersonId)
if (value === '') { if (this.planPersonId === undefined || this.planPersonId === null || this.planPersonId === '') {
callback(new Error('请选择')) callback(new Error('请选择计划员'))
} else {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
console.log(this.stockPersonId)
if (this.stockPersonId === undefined || this.stockPersonId === null || this.stockPersonId === '') {
callback(new Error('请选择采购员'))
} else {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.personalForm.stockDeptId)
if (this.personalForm.stockDeptId === undefined || this.personalForm.stockDeptId === null || this.personalForm.stockDeptId === '') {
callback(new Error('请选择采购部门'))
} else { } else {
callback() callback()
} }
} }
return { return {
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
}
},
// code
procode: null,
// scope
kongscope: '',
// //
choosedata: [], choosedata: [],
// //
@ -267,16 +296,16 @@ export default {
{ required: true, message: '请选择计划日期', trigger: 'change' } { required: true, message: '请选择计划日期', trigger: 'change' }
], ],
stockDeptId: [ stockDeptId: [
{ required: true, message: '请选择采购部门', trigger: 'change' } { required: true, validator: validatePass3, trigger: 'change' }
], ],
sourceType: [ sourceType: [
{ required: true, message: '请选择源单类型', trigger: 'change' } { required: true, message: '请选择源单类型', trigger: 'change' }
], ],
planPersonId: [ planPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass, trigger: 'change' }
], ],
stockPersonId: [ stockPersonId: [
{ required: true, validator: validatePass, trigger: 'focus' } { required: true, validator: validatePass2, trigger: 'change' }
] ]
}, },
// //
@ -285,6 +314,12 @@ export default {
list3: [], list3: [],
// //
validRules: { validRules: {
supplierName: [
{ required: true, message: '请选择供应商', trigger: 'none' }
],
planQuantity: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
]
} }
} }
}, },
@ -298,6 +333,7 @@ export default {
this.stockPersonId = this.personalForm.stockPersonName this.stockPersonId = this.personalForm.stockPersonName
this.list2 = this.personalForm.stockPlanDetailVos this.list2 = this.personalForm.stockPlanDetailVos
this.list3 = this.personalForm.stockPlanDetailVos this.list3 = this.personalForm.stockPlanDetailVos
this.getdatatime()
this.chooseType() this.chooseType()
} }
}, },
@ -305,11 +341,25 @@ export default {
this.getTypes() this.getTypes()
}, },
methods: { methods: {
planQuantity(row) {
return (row.planQuantity).toFixed(2)
},
//
change() {
this.$forceUpdate()
},
getdatatime() { //
this.personalForm.planDate = new Date()
},
// //
planMoney(row) { planMoney(row) {
row.planMoney = row.basicPrice * row.planQuantity row.planMoney = (row.basicPrice * row.planQuantity).toFixed(2)
return row.planMoney return row.planMoney
}, },
//
basicPrice(row) {
return (row.basicPrice).toFixed(2)
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -324,9 +374,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return (Number(prev) + Number(curr)).toFixed(2)
} else { } else {
return prev return (Number(prev)).toFixed(2)
} }
}, 0) }, 0)
sums[index] += '' sums[index] += ''
@ -347,15 +397,6 @@ export default {
sums[12] = '' sums[12] = ''
return sums return sums
}, },
//
basicPrice(row) {
productlist(row.productCode).then(res => {
if (res.data.ret === 200) {
row.basicPrice = res.data.data.content.list[0].purchasePrice
}
})
return row.basicPrice
},
// //
changeDate(scope, value) { changeDate(scope, value) {
this.$refs.editable2.clear() this.$refs.editable2.clear()
@ -365,13 +406,15 @@ export default {
} }
}, },
// focus // focus
handlechoose() { handlechoose(scope) {
this.empcontrol = true this.empcontrol = true
this.kongscope = scope
this.procode = scope.row.productCode
}, },
// //
personName(scope, val) { personName(scope, val) {
scope.row.supplierName = val.supplierName this.kongscope.row.supplierName = val.supplierName
scope.row.supplierId = val.id this.kongscope.row.supplierId = val.id
this.$refs.editable2.clear() this.$refs.editable2.clear()
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
console.log(nowlistdata) console.log(nowlistdata)
@ -385,14 +428,22 @@ export default {
console.log(this.personalForm.sourceType) console.log(this.personalForm.sourceType)
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') { if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
this.addsouce = false this.addsouce = false
this.addpro = true this.addpro = false
this.$refs.editable.clear() if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable2.clear() this.$refs.editable.clear()
}
if (this.$refs.editable2.getRecords().length !== 0) {
this.$refs.editable2.clear()
}
} else if (this.personalForm.sourceType === '3') { } else if (this.personalForm.sourceType === '3') {
this.addpro = false this.addpro = false
this.addsouce = true this.addsouce = true
this.$refs.editable.clear() if (this.$refs.editable.getRecords().length !== 0) {
this.$refs.editable2.clear() this.$refs.editable.clear()
}
if (this.$refs.editable2.getRecords().length !== 0) {
this.$refs.editable2.clear()
}
} }
}, },
// //
@ -441,8 +492,11 @@ export default {
this.requirecontrol = true this.requirecontrol = true
} }
}, },
apply(val) { allinfo(val) {
console.log(val) console.log(val)
this.personalForm.planDate = val.applyDate
},
apply(val) {
const nowlistdata = this.$refs.editable.getRecords() const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) { for (let j = 0; j < nowlistdata.length; j++) {
@ -560,6 +614,7 @@ export default {
deliveryName(val) { deliveryName(val) {
this.stockPersonId = val.personName this.stockPersonId = val.personName
this.personalForm.stockPersonId = val.id this.personalForm.stockPersonId = val.id
this.personalForm.stockDeptId = val.deptId
}, },
// //
restAllForm() { restAllForm() {
@ -642,27 +697,42 @@ export default {
} }
} }
const parms = JSON.stringify(Data) const parms = JSON.stringify(Data)
updatestockplan(parms, parms2).then(res => { this.$refs.personalForm.validate((valid) => {
if (res.data.ret === 200) { if (valid) {
this.$notify({ this.$refs.editable.validate().then(valid => {
title: '操作成功', updatestockplan(parms, parms2).then(res => {
message: '操作成功', if (res.data.ret === 200) {
type: 'success', this.$notify({
duration: 1000, title: '操作成功',
offset: 100 message: '操作成功',
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
}).catch(valid => {
console.log('error submit!!')
}) })
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
} else { } else {
this.$notify.error({ this.$notify.error({
title: '错误', title: '错误',
message: '出错了', message: '信息未填完整',
offset: 100 offset: 100
}) })
return false
} }
}) })
}, },

View file

@ -295,12 +295,15 @@ export default {
unit: item.unit, unit: item.unit,
color: item.color, color: item.color,
basicQuantity: item.requireQuantity, basicQuantity: item.requireQuantity,
planQuantity: item.requireQuantity,
planDeliveryDate: item.requireDate, planDeliveryDate: item.requireDate,
applyReason: '', applyReason: '',
sourceNumber: item.materialsRequireNumber, sourceNumber: item.materialsRequireNumber,
supplierId: '', supplierId: '',
supplierName: '', supplierName: '',
basicPrice: '' basicPrice: 0,
planMoney: '0.00',
orderQuantity: '0.00'
} }
}) })
this.$emit('require', requireDetail) this.$emit('require', requireDetail)

View file

@ -0,0 +1,303 @@
<template>
<el-dialog :visible.sync="employeeVisible" :control="control" :procode="procode" :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.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
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<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" @click="visible2 = !visible2">{{ $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;float: right" @click="handleAdd">{{ $t('public.add') }}</el-button>
</div>
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<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>
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<el-button v-waves class="filter-item" type="success" @click="handleConfirm">确认添加</el-button>
</el-dialog>
</template>
<script>
import { searchRepository, regionlist } from '@/api/public'
import { searchCategory, search } from '@/api/Supplier'
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
},
procode: {
type: String,
default: null
}
},
data() {
return {
//
visible2: false,
//
choosedata: '',
//
moreaction: '',
//
levelIds: [],
//
typeIds: [],
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
id: '',
supplierName: '',
typeId: '',
regionId: '',
levelId: '',
pagenum: 1,
pagesize: 10,
productCode: this.procode
},
//
depts: [],
//
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions: [],
getemplistregions: [],
//
repositories: [],
//
employeeVisible: this.control,
//
regionManagerVisible: false
}
},
watch: {
control() {
this.employeeVisible = this.control
},
procode() {
this.getemplist.productCode = this.procode
console.log(this.procode)
this.getlist()
}
},
created() {
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
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
searchCategory(1).then(res => {
if (res.data.ret === 200) {
this.typeIds = res.data.data.content.list
}
})
//
searchCategory(4).then(res => {
if (res.data.ret === 200) {
this.levelIds = res.data.data.content.list
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions = 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.pagenum = 1
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
}
})
},
//
handleAdd() {
this.$router.push('/Supplier/NewSupplier')
},
//
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
}
})
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('supplierName', this.choosedata)
},
//
handleCurrentChange(val) {
this.choosedata = val
}
//
}
}
</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>

View file

@ -17,6 +17,7 @@
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px" @change="chooseType"> <el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px" @change="chooseType">
<el-option value="1" label="采购到货单" /> <el-option value="1" label="采购到货单" />
<el-option value="2" label="无来源" /> <el-option value="2" label="无来源" />
<el-option value="3" label="采购入库单" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -115,6 +116,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item v-if="personalForm.sourceType === '3'" :label="$t('StockRetreat.retreatRepositoryId')" prop="retreatRepositoryId" style="width: 100%;">
<el-input v-model="retreatRepositoryId" style="margin-left: 18px" clearable @focus="handlechooseRep"/>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
@ -154,11 +161,27 @@
<el-editable-column prop="price" align="center" label="单价" min-width="170px"/> <el-editable-column prop="price" align="center" label="单价" min-width="170px"/>
<el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/> <el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/> <el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/> <el-editable-column prop="money" align="center" label="金额" min-width="150px">
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/> <template slot-scope="scope">
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/> <p>{{ getMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/> <el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot-scope="scope">
<p>{{ getdiscountMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="remark" align="center" label="备注" min-width="150px"/> <el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
@ -222,9 +245,10 @@ import MyDelivery from './components/MyDelivery'
import MyLnquiry from './components/MyLnquiry' import MyLnquiry from './components/MyLnquiry'
import MyOrder from './components/MyOrder' import MyOrder from './components/MyOrder'
import MyArrival from './components/MyArrival' import MyArrival from './components/MyArrival'
import MyRepository from './components/MyRepository'
export default { export default {
name: 'AddStockRetreat', name: 'AddStockRetreat',
components: { MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp }, components: { MyRepository, MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
console.log(value) console.log(value)
@ -235,6 +259,10 @@ export default {
} }
} }
return { return {
//
retreatRepositoryId: '',
//
repositorycontrol: false,
// //
allNumber: '', allNumber: '',
allMoney: '', allMoney: '',
@ -307,6 +335,9 @@ export default {
], ],
stockTypeId: [ stockTypeId: [
{ required: true, message: '请选择采购类别', trigger: 'change' } { required: true, message: '请选择采购类别', trigger: 'change' }
],
retreatRepositoryId: [
{ required: true, validator: validatePass, trigger: 'focus' }
] ]
}, },
// //
@ -321,6 +352,15 @@ export default {
this.getways() this.getways()
}, },
methods: { methods: {
// focus
handlechooseRep() {
this.repositorycontrol = true
},
repositoryname(val) {
console.log(val)
this.retreatRepositoryId = val.repositoryName
this.personalForm.retreatRepositoryId = val.id
},
// //
getSummaries(param) { getSummaries(param) {
const { columns, data } = param const { columns, data } = param
@ -362,6 +402,25 @@ export default {
this.allMoneyMoveDiscount = sums[13] - sums[16] this.allMoneyMoveDiscount = sums[13] - sums[16]
return sums return sums
}, },
getdiscountMoney(row) {
row.discountMoney = row.discountRate * row.retreatQuantity * (1 - row.discountRate / 100)
return row.discountMoney
},
//
getTaxMoney2(row) {
row.taxMoney = (row.price * row.taxRate / 100 * row.retreatQuantity).toFixed(2)
return row.taxMoney
},
//
getTaxMoney(row) {
row.includeTaxMoney = (row.retreatQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney
},
//
getMoney(row) {
row.money = (row.retreatQuantity * row.price).toFixed(2)
return row.money
},
getways() { getways() {
// //
searchCategory(2).then(res => { searchCategory(2).then(res => {
@ -558,41 +617,29 @@ export default {
delete elem.taxRate delete elem.taxRate
} }
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) { if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = (elem.taxRate).toFixed(2) elem.taxRate = elem.taxRate / 100
} }
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) { if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = (elem.discountRate).toFixed(2) elem.discountRate = elem.discountRate / 100
} }
if (elem.money === null || elem.money === '' || elem.money === undefined) { if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money delete elem.money
} }
if (elem.money !== null || elem.money !== '' || elem.money !== undefined) {
elem.money = (elem.money).toFixed(2)
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) { if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney delete elem.includeTaxMoney
} }
if (elem.includeTaxMoney !== null || elem.includeTaxMoney !== '' || elem.includeTaxMoney !== undefined) {
elem.includeTaxMoney = (elem.includeTaxMoney).toFixed(2)
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) { if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney delete elem.taxMoney
} }
if (elem.taxMoney !== null || elem.taxMoney !== '' || elem.taxMoney !== undefined) {
elem.taxMoney = (elem.taxMoney).toFixed(2)
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) { if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate delete elem.discountRate
} }
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) { if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney delete elem.discountMoney
} }
if (elem.discountMoney !== null || elem.discountMoney !== '' || elem.discountMoney !== undefined) {
elem.discountMoney = (elem.discountMoney).toFixed(2)
}
if (elem.remark === null || elem.remark === '' || elem.remark === undefined) { if (elem.remark === null || elem.remark === '' || elem.remark === undefined) {
delete elem.remark delete elem.remark
} }

View file

@ -363,12 +363,12 @@ export default {
remark: item.remark, remark: item.remark,
price: item.price, price: item.price,
includeTaxPrice: item.includeTaxPrice, includeTaxPrice: item.includeTaxPrice,
taxRate: item.taxRate, taxRate: item.taxRate * 100,
money: item.money, money: item.money,
includeTaxMoney: item.includeTaxMoney, includeTaxMoney: item.includeTaxMoney,
taxMoney: item.taxMoney, taxMoney: item.taxMoney,
discountMoney: item.discountMoney, discountMoney: item.discountMoney,
discountRate: item.discountRate discountRate: item.discountRate * 100
} }
}) })
console.log(arrivalDetail) console.log(arrivalDetail)

View file

@ -155,11 +155,27 @@
<el-editable-column prop="price" align="center" label="单价" min-width="170px"/> <el-editable-column prop="price" align="center" label="单价" min-width="170px"/>
<el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/> <el-editable-column prop="includeTaxPrice" align="center" label="含税价" min-width="170px"/>
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/> <el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px"/>
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/> <el-editable-column prop="money" align="center" label="金额" min-width="150px">
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/> <template slot-scope="scope">
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/> <p>{{ getMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px">
<template slot-scope="scope">
<p>{{ getTaxMoney2(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/> <el-editable-column prop="discountRate" align="center" label="折扣率(%)" min-width="170px"/>
<el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px"/> <el-editable-column prop="discountMoney" align="center" label="折扣额" min-width="170px">
<template slot-scope="scope">
<p>{{ getdiscountMoney(scope.row) }}</p>
</template>
</el-editable-column>
<el-editable-column prop="remark" align="center" label="备注" min-width="150px"/> <el-editable-column prop="remark" align="center" label="备注" min-width="150px"/>
<el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/> <el-editable-column prop="sourceNumber" align="center" label="源单编号" min-width="150px"/>
<el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/> <el-editable-column prop="sourceSerialNumber" align="center" label="源单序号" min-width="150px"/>
@ -380,6 +396,25 @@ export default {
this.allMoneyMoveDiscount = sums[13] - sums[16] this.allMoneyMoveDiscount = sums[13] - sums[16]
return sums return sums
}, },
getdiscountMoney(row) {
row.discountMoney = row.discountRate * row.retreatQuantity * (1 - row.discountRate / 100)
return row.discountMoney
},
//
getTaxMoney2(row) {
row.taxMoney = (row.price * row.taxRate / 100 * row.retreatQuantity).toFixed(2)
return row.taxMoney
},
//
getTaxMoney(row) {
row.includeTaxMoney = (row.retreatQuantity * row.includeTaxPrice).toFixed(2)
return row.includeTaxMoney
},
//
getMoney(row) {
row.money = (row.retreatQuantity * row.price).toFixed(2)
return row.money
},
getways() { getways() {
// //
searchCategory(2).then(res => { searchCategory(2).then(res => {

View file

@ -0,0 +1,263 @@
<template>
<el-dialog :visible.sync="repositoryVisible" :repositorycontrol="repositorycontrol" :close-on-press-escape="false" top="10px" title="选择仓库" append-to-body @close="$emit('update:repositorycontrol', false)">
<div class="filter-container">
<!-- 搜索条件栏目 -->
<el-input v-model="getemplist.id" :placeholder="$t('Repository.id')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.repositoryName" :placeholder="$t('Repository.repositoryname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Repository.type2')" class="filter-item" clearable>
<el-option
v-for="(item, index) in types"
:key="index"
:value="item.id"
:label="item.categoryName"
/>
</el-select>
<el-select v-model="getemplist.iseffective" :value="getemplist.iseffective" :placeholder="$t('Repository.iseffective')" class="filter-item" clearable>
<el-option label="启用" value="1"/>
<el-option label="停用" value="2"/>
</el-select>
<el-cascader
:options="regions"
:props="props"
v-model="getemplistregions"
:show-all-levels="false"
placeholder="请选择区域"
change-on-select
filterable
clearable
class="filter-item"
/>
<el-select v-model="getemplist.countyrId" placeholder="请选择国家" class="filter-item" clearable>
<el-option
v-for="(item, index) in nations"
:key="index"
:label="item.name"
:value="item.id"/>
</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-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"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('Repository.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('Repository.repositoryname')" :resizable="false" prop="repositoryName" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.repositoryName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Repository.type2')" :resizable="false" prop="categoryName" align="center" width="230">
<template slot-scope="scope">
<span>{{ scope.row.categoryName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Repository.iseffective')" :resizable="false" prop="stat" align="center" width="230">
<template slot-scope="scope">
<span>{{ scope.row.stat | iseffectiveFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Repository.managerPeople')" :resizable="false" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.managerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Repository.regionId')" :resizable="false" prop="regionName" align="center" width="250">
<template slot-scope="scope">
<span>{{ scope.row.regionName }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">确认添加</el-button>
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
</el-dialog>
</template>
<script>
import { regionlist, getcountrylist } from '@/api/public'
import { searchRepCategory, searchRepository2 } from '@/api/Repository'
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: {
iseffectiveFilter(status) {
const statusMap = {
1: '启用',
2: '停用'
}
return statusMap[status]
},
genderFilter(status) {
const statusMap = {
1: '男',
2: '女'
}
return statusMap[status]
}
},
props: {
repositorycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
repositoryVisible: this.repositorycontrol,
//
choosedata: '',
//
types: [],
//
nations: [],
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
repositoryName: '',
type: '',
iseffective: '',
regionId: '',
countyrId: '',
id: '',
pagenum: 1,
pagesize: 10
},
//
depts: [],
//
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions: [],
getemplistregions: [],
getemplistregions0: []
}
},
watch: {
repositorycontrol() {
this.repositoryVisible = this.repositorycontrol
}
},
created() {
this.getlist()
},
methods: {
getlist() {
//
getcountrylist().then(res => {
if (res.data.ret === 200) {
this.nations = res.data.data.content
}
})
//
this.listLoading = true
searchRepository2(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
searchRepCategory().then(res => {
if (res.data.ret === 200) {
console.log(res)
this.types = res.data.data.content.list
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions = this.tranKTree(res.data.data.content)
}
})
},
//
handleFilter() {
this.getemplist.pagenum = 1
this.getemplist.regionId = this.getemplistregions[this.getemplistregions.length - 1]
console.log(this.getemplist)
searchRepository2(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.repositoryVisible = true
}
})
},
//
handleAdd() {
this.$router.push('/Repository/NewRepository')
this.repositoryVisible = false
},
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
},
//
handleConfirm() {
this.$emit('repositoryname', this.choosedata)
this.repositoryVisible = false
},
//
handleCurrentChange(val) {
this.choosedata = val
}
}
}
</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>

View file

@ -606,7 +606,7 @@ export default {
provinceId: '', provinceId: '',
cityId: '', cityId: '',
detailAddress: '', detailAddress: '',
groupId: '', groupId: [],
zipCode: '', zipCode: '',
contactPersonName: '', contactPersonName: '',
contactPersonPhone: '', contactPersonPhone: '',

View file

@ -348,6 +348,7 @@ export default {
}, },
// //
refreshlist(val) { refreshlist(val) {
console.log(val)
if (val === true) { if (val === true) {
this.getlist() this.getlist()
} }

View file

@ -635,6 +635,7 @@ export default {
type: 'success', type: 'success',
offset: 100 offset: 100
}) })
this.$emit('rest', true)
this.restAllForm() this.restAllForm()
this.$refs.editable.clear() this.$refs.editable.clear()
this.$refs.personalForm.clearValidate() this.$refs.personalForm.clearValidate()