mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 06:56:07 +08:00
采购大量修改
This commit is contained in:
parent
b1633d5353
commit
fe7d513b78
File diff suppressed because one or more lines are too long
11
README.md
11
README.md
|
@ -230,6 +230,17 @@ const reg = /^[A-Z0-9]{2}$/
|
|||
}
|
||||
// 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
|
||||
|
|
|
@ -113,8 +113,8 @@ export function createnewproduct(query) {
|
|||
if (query.categoryid !== '' && query.categoryid !== null && query.categoryid !== undefined) {
|
||||
params.append('categoryid', query.categoryid) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.color !== '' && query.color !== null && query.color !== undefined) {
|
||||
params.append('color', query.color) // 你要传给后台的参数值 key/value
|
||||
if (query.colorId !== '' && query.colorId !== null && query.colorId !== undefined) {
|
||||
params.append('colorId', query.colorId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.brand !== '' && query.brand !== null && query.brand !== undefined) {
|
||||
params.append('brand', query.brand) // 你要传给后台的参数值 key/value
|
||||
|
@ -307,6 +307,12 @@ export function deleteproduct(query) {
|
|||
// 修改商品
|
||||
export function editproduct(query) {
|
||||
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) {
|
||||
params.append('effectiveDay', query.effectiveDay) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
|
|
13
src/api/SaleOpportunity.js
Normal file
13
src/api/SaleOpportunity.js
Normal 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
|
||||
})
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 添加销售订单
|
||||
export function createsaleOrder(query, query2, query3, query4) {
|
||||
export function createsaleOrder(query, query2, query4) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('Json', query) // 你要传给后台的参数值 key/value
|
||||
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
|
||||
params.append('costDetailJson', query3) // 你要传给后台的参数值 key/value
|
||||
if (query4.repositoryId !== '' && query4.repositoryId !== null && query4.repositoryId !== undefined) {
|
||||
params.append('repositoryId', query4.repositoryId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
|
|
100
src/api/SaleReturn.js
Normal file
100
src/api/SaleReturn.js
Normal 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
|
||||
})
|
||||
}
|
|
@ -60,6 +60,9 @@ export function stockplanlist(query) {
|
|||
if (query.regionIds !== '' && query.regionIds !== null && query.regionIds !== undefined) {
|
||||
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('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
|
|
|
@ -128,6 +128,9 @@ export function search(query) {
|
|||
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
|
||||
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) {
|
||||
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
var params = new URLSearchParams()
|
||||
|
|
1
src/icons/svg/xiaoshoujihua.svg
Normal file
1
src/icons/svg/xiaoshoujihua.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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 |
1
src/icons/svg/xiaoshoujihui.svg
Normal file
1
src/icons/svg/xiaoshoujihui.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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 |
|
@ -201,6 +201,15 @@ export default {
|
|||
SaleReturn: '销售退货单',
|
||||
AddSaleReturn: '新建销售退货单',
|
||||
SaleReturnList: '销售退货单列表',
|
||||
SalePlan: '销售计划',
|
||||
AddSalePlan: '新增销售计划',
|
||||
SalePlanList: '销售计划列表',
|
||||
SaleOpportunity: '销售机会',
|
||||
AddSaleOpportunity: '新增销售机会',
|
||||
SaleOpportunityList: '销售机会列表',
|
||||
SaleContract: '销售合同',
|
||||
AddSaleContract: '新建销售合同',
|
||||
SaleContractList: '销售合同列表',
|
||||
CheckCategory: '分类属性',
|
||||
CheckCategoryList: '分类属性列表'
|
||||
},
|
||||
|
@ -1000,6 +1009,7 @@ export default {
|
|||
allIncludeTaxMoney: '含税金额合计'
|
||||
},
|
||||
StockOrder: {
|
||||
supplierNumber: '供应方订单号',
|
||||
title: '采购订货单主题',
|
||||
orderNumber: '采购单号',
|
||||
sourceType: '源单类型',
|
||||
|
@ -1054,7 +1064,8 @@ export default {
|
|||
acceptAddress: '收货地址',
|
||||
retreatDate: '退货日期',
|
||||
isVat: '是否为增值税',
|
||||
allRetreatMoney: '应退款合计'
|
||||
allRetreatMoney: '应退款合计',
|
||||
retreatRepositoryId: '退货仓库'
|
||||
},
|
||||
StockQuery: {
|
||||
productName: '物品名称',
|
||||
|
@ -1281,7 +1292,33 @@ export default {
|
|||
alreadyMoney: '已结金额',
|
||||
enterStatusId: '入库情况',
|
||||
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: {
|
||||
modifyDate: '最后修改日期',
|
||||
|
|
|
@ -1456,6 +1456,52 @@ export const asyncRouterMap = [
|
|||
component: () => import('@/views/SaleReturn/AddSaleReturn'),
|
||||
name: 'AddSaleReturn',
|
||||
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 }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -70,17 +70,18 @@
|
|||
@select="selectEvent"
|
||||
@current-change="currentChangeEvent">
|
||||
<el-editable-column type="selection" width="55" align="center"/>
|
||||
<el-editable-column label="流程步骤" prop="step" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ handleStep(scope.row, scope.$index) }}</span>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<!--<el-editable-column label="流程步骤" prop="step" type="index" align="center" width="150px"/>-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<span>{{ handleStep(scope.row, scope.$index) }}</span>-->
|
||||
<!--</template>-->
|
||||
<!--</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="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', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px">
|
||||
<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)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
|
@ -111,6 +112,8 @@ export default {
|
|||
components: { MyEmp },
|
||||
data() {
|
||||
return {
|
||||
// 控制scope
|
||||
kongscope: '',
|
||||
// 步骤
|
||||
step: 1,
|
||||
// 步骤处理人id
|
||||
|
@ -123,9 +126,6 @@ export default {
|
|||
categorys: [],
|
||||
// 审批流程列表规则
|
||||
validRules: {
|
||||
step: [
|
||||
{ required: true, message: '请输入流程步骤', trigger: 'blur' }
|
||||
],
|
||||
handlerName: [
|
||||
{ required: true, message: '请选择步骤处理人', trigger: 'blue' }
|
||||
]
|
||||
|
@ -266,13 +266,10 @@ export default {
|
|||
},
|
||||
// 审核人选择
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
handlechoose(scope) {
|
||||
this.empcontrol = true
|
||||
},
|
||||
handleStep(row, index) {
|
||||
console.log(index)
|
||||
row.step = index + 1
|
||||
return row.step
|
||||
console.log(scope)
|
||||
this.kongscope = scope
|
||||
},
|
||||
// 处理人change事件
|
||||
fuzhi(scope) {
|
||||
|
@ -281,8 +278,18 @@ export default {
|
|||
chuli(scope, val) {
|
||||
console.log(val)
|
||||
console.log(scope)
|
||||
scope.row.handlerName = val.personName
|
||||
scope.row.stepHandler = val.id
|
||||
this.kongscope.row.handlerName = val.personName
|
||||
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) {
|
||||
// 提交请求
|
||||
|
@ -298,8 +305,8 @@ export default {
|
|||
console.log(row)
|
||||
},
|
||||
// 新增审批流程
|
||||
insertEvent() {
|
||||
this.$refs.editable.insertAt(-1)
|
||||
insertEvent(index) {
|
||||
this.$refs.editable.insertAt({ step: null }, index)
|
||||
},
|
||||
// 选择操作
|
||||
currentChangeEvent(currentRow, oldCurrentRow) {
|
||||
|
|
|
@ -52,13 +52,13 @@
|
|||
@select="selectEvent"
|
||||
@current-change="currentChangeEvent">
|
||||
<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="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', type: 'visible'}" prop="handlerName" align="center" label="步骤处理人" min-width="500px">
|
||||
<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)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
|
@ -96,6 +96,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
// 控制scope
|
||||
kongscope: '',
|
||||
// 区域数据
|
||||
region: [],
|
||||
// 弹窗组件的控制
|
||||
|
@ -212,8 +214,9 @@ export default {
|
|||
},
|
||||
// 审核人选择
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
handlechoose(scope) {
|
||||
this.empcontrol = true
|
||||
this.kongscope = scope
|
||||
},
|
||||
// 处理人change事件
|
||||
fuzhi(scope) {
|
||||
|
@ -225,20 +228,26 @@ export default {
|
|||
this.stepHandler = val.id
|
||||
},
|
||||
chuli(scope, val) {
|
||||
console.log(val)
|
||||
console.log(scope)
|
||||
scope.row.handlerName = val.personName
|
||||
scope.row.stepHandler = val.id
|
||||
this.kongscope.row.handlerName = val.personName
|
||||
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
|
||||
}
|
||||
},
|
||||
// edit table 操作
|
||||
selectEvent(selection, row) {
|
||||
console.log(selection)
|
||||
console.log(row)
|
||||
},
|
||||
handleStep(row) {
|
||||
console.log(row)
|
||||
},
|
||||
// 新增审批流程
|
||||
insertEvent(index) {
|
||||
const row = this.$refs.editable.insertAt(null, index)
|
||||
this.$nextTick(() => this.$refs.editable.setActiveCell(row, 'handlerName'))
|
||||
this.$refs.editable.insertAt({ step: 1 }, index)
|
||||
},
|
||||
// 选择操作
|
||||
currentChangeEvent(currentRow, oldCurrentRow) {
|
||||
|
|
|
@ -284,6 +284,7 @@ export default {
|
|||
handleConfirm() {
|
||||
this.employeeVisible = false
|
||||
this.$emit('chuli', this.choosedata)
|
||||
this.$emit('personName', this.choosedata)
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
|
|
|
@ -261,7 +261,9 @@ export default {
|
|||
if (this.personalForm.valuation !== null && this.personalForm.valuation !== undefined) {
|
||||
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) {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<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('Product.productname')" prop="productname" style="width: 100%;">
|
||||
<el-input v-model="personalForm.productName" style="margin-left: 18px;width: 200px" placeholder="请输入产品名称" clearable/>
|
||||
<el-form-item :label="$t('Product.productname')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.productName" style="margin-left: 18px;width: 200px" placeholder="请输入产品名称" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -162,12 +162,7 @@
|
|||
</el-form-item>
|
||||
</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-form-item :label="$t('Product.stockCircle')" prop="stockCircle" style="width: 100%;">
|
||||
<el-form-item :label="$t('Product.stockCircle')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.stockCircle" placeholder="请输采购周期(天)" clearable style="margin-left: 18px;width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -187,6 +182,11 @@
|
|||
<my-center :control.sync="centercontrol" @center="center"/>
|
||||
</el-form-item>
|
||||
</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-form-item :label="$t('Product.isBatch')" prop="isBatch" style="width: 100%;">
|
||||
<el-radio-group v-model="personalForm.isBatch" style="margin-left: 18px;width: 200px">
|
||||
|
|
|
@ -207,13 +207,23 @@ export default {
|
|||
this.editVisible = true
|
||||
this.edittreeform = Object.assign({}, data)
|
||||
},
|
||||
// 递归函数
|
||||
recursion(val) {
|
||||
if (val.level === 1) {
|
||||
return val.data
|
||||
} else {
|
||||
return this.recursion(val.parent)
|
||||
}
|
||||
},
|
||||
// 选择节点操作
|
||||
handleNodeClick(data, node) {
|
||||
this.personalForm.parentId = data.id
|
||||
this.Iscode = data.code
|
||||
this.parentId = data.categoryName
|
||||
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.weishu = '1位'
|
||||
} else {
|
||||
|
|
398
src/views/SaleOpportunity/AddSaleOpportunity.vue
Normal file
398
src/views/SaleOpportunity/AddSaleOpportunity.vue
Normal 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>
|
416
src/views/SaleOpportunity/components/DetailList.vue
Normal file
416
src/views/SaleOpportunity/components/DetailList.vue
Normal 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>
|
357
src/views/SaleOpportunity/components/MyAgent.vue
Normal file
357
src/views/SaleOpportunity/components/MyAgent.vue
Normal 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>
|
368
src/views/SaleOpportunity/components/MyApply.vue
Normal file
368
src/views/SaleOpportunity/components/MyApply.vue
Normal 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>
|
365
src/views/SaleOpportunity/components/MyCustomer.vue
Normal file
365
src/views/SaleOpportunity/components/MyCustomer.vue
Normal 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>
|
326
src/views/SaleOpportunity/components/MyDelivery.vue
Normal file
326
src/views/SaleOpportunity/components/MyDelivery.vue
Normal 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>
|
302
src/views/SaleOpportunity/components/MyDetail.vue
Normal file
302
src/views/SaleOpportunity/components/MyDetail.vue
Normal 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>
|
755
src/views/SaleOpportunity/components/MyDialog.vue
Normal file
755
src/views/SaleOpportunity/components/MyDialog.vue
Normal 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>
|
332
src/views/SaleOpportunity/components/MyEmp.vue
Normal file
332
src/views/SaleOpportunity/components/MyEmp.vue
Normal 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>
|
331
src/views/SaleOpportunity/components/MyRequire.vue
Normal file
331
src/views/SaleOpportunity/components/MyRequire.vue
Normal 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>
|
|
@ -605,7 +605,6 @@ export default {
|
|||
// 保存操作
|
||||
handlesave() {
|
||||
const EnterDetail = this.$refs.editable.getRecords()
|
||||
const EnterDetail2 = this.$refs.editable2.getRecords()
|
||||
if (EnterDetail.length === 0) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
|
@ -679,22 +678,7 @@ export default {
|
|||
}
|
||||
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 parms3 = JSON.stringify(EnterDetail2)
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -704,7 +688,7 @@ export default {
|
|||
const parms = JSON.stringify(Data)
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
createsaleOrder(parms, parms2, parms3, this.personalForm).then(res => {
|
||||
createsaleOrder(parms, parms2, this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
|
|
|
@ -336,7 +336,11 @@ export default {
|
|||
sourceNumber: number,
|
||||
supplierId: '',
|
||||
supplierName: '',
|
||||
basicPrice: ''
|
||||
basicPrice: '0.00',
|
||||
requireQuantity: item.requireQuantity,
|
||||
planQuantity: item.requireQuantity,
|
||||
requireDate: item.requireDate,
|
||||
planMoney: '0.00'
|
||||
}
|
||||
})
|
||||
this.$emit('apply', applyDetail)
|
||||
|
|
832
src/views/SalePlan/AddSalePlan.vue
Normal file
832
src/views/SalePlan/AddSalePlan.vue
Normal 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>
|
416
src/views/SalePlan/components/DetailList.vue
Normal file
416
src/views/SalePlan/components/DetailList.vue
Normal 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>
|
357
src/views/SalePlan/components/MyAgent.vue
Normal file
357
src/views/SalePlan/components/MyAgent.vue
Normal 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>
|
368
src/views/SalePlan/components/MyApply.vue
Normal file
368
src/views/SalePlan/components/MyApply.vue
Normal 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>
|
365
src/views/SalePlan/components/MyCustomer.vue
Normal file
365
src/views/SalePlan/components/MyCustomer.vue
Normal 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>
|
326
src/views/SalePlan/components/MyDelivery.vue
Normal file
326
src/views/SalePlan/components/MyDelivery.vue
Normal 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>
|
313
src/views/SalePlan/components/MyDetail.vue
Normal file
313
src/views/SalePlan/components/MyDetail.vue
Normal 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>
|
717
src/views/SalePlan/components/MyDialog.vue
Normal file
717
src/views/SalePlan/components/MyDialog.vue
Normal 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>
|
332
src/views/SalePlan/components/MyEmp.vue
Normal file
332
src/views/SalePlan/components/MyEmp.vue
Normal 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>
|
331
src/views/SalePlan/components/MyRequire.vue
Normal file
331
src/views/SalePlan/components/MyRequire.vue
Normal 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>
|
|
@ -65,7 +65,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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"/>
|
||||
<my-emp :control.sync="stockControl" @stockName="stockName"/>
|
||||
</el-form-item>
|
||||
|
@ -124,8 +124,18 @@
|
|||
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 :edit-render="{type: 'visible'}" prop="locationId" align="center" label="货位" min-width="170px">
|
||||
<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="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="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"/>
|
||||
<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"/>
|
||||
|
@ -245,8 +262,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// import { createSaleReturn } from '@/api/SaleOrder'
|
||||
import { createsaleReturn } from '@/api/SaleReturn'
|
||||
import { searchSaleCategory } from '@/api/SaleCategory'
|
||||
import { getlocation, locationlist } from '@/api/public'
|
||||
import MyEmp from './components/MyEmp'
|
||||
import MyDelivery from '../DailyAdjust/components/MyDelivery'
|
||||
import MyDetail from './components/MyDetail'
|
||||
|
@ -277,6 +295,8 @@ export default {
|
|||
heji7: '',
|
||||
heji8: '',
|
||||
heji9: '',
|
||||
// 货位数据
|
||||
locationlist: [],
|
||||
// 控制源单编码是否可以选择
|
||||
IsNumber: true,
|
||||
// 控制添加商品按钮是否可以点击
|
||||
|
@ -300,7 +320,8 @@ export default {
|
|||
colseTypeparms: {
|
||||
type: 3,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
pagesize: 99999,
|
||||
iseffective: 1
|
||||
},
|
||||
// 控制商品列表窗口
|
||||
control: false,
|
||||
|
@ -317,7 +338,10 @@ export default {
|
|||
customerType: [
|
||||
{ required: true, message: '请选择客户类别', trigger: 'change' }
|
||||
],
|
||||
customerName: [
|
||||
salePersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
],
|
||||
customerId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
],
|
||||
returnDate: [
|
||||
|
@ -346,6 +370,39 @@ export default {
|
|||
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') {
|
||||
|
@ -411,17 +468,17 @@ export default {
|
|||
},
|
||||
// 通过数量计算成本金额, 含税金额, 金额, 含税成本金额
|
||||
getquantity(row) {
|
||||
row.costMoney = row.quantity * row.costPrice
|
||||
row.includeTaxMoney = row.quantity * row.taxprice
|
||||
row.money = row.quantity * row.salePrice
|
||||
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.quantity).toFixed(2)
|
||||
if (row.quantity !== 0) {
|
||||
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2)
|
||||
row.discount = (1 - row.discountMoney / row.salePrice / row.quantity).toFixed(2)
|
||||
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.quantity * (1 - row.discount)).toFixed(2)
|
||||
return row.quantity
|
||||
row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
|
||||
return row.returnQuantity
|
||||
},
|
||||
// 计算含税价
|
||||
gettaxprice(row) {
|
||||
|
@ -492,20 +549,6 @@ export default {
|
|||
updatecountry() {
|
||||
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事件
|
||||
handlechooseStock() {
|
||||
this.stockControl = true
|
||||
|
@ -515,7 +558,7 @@ export default {
|
|||
this.salePersonId = val.personName
|
||||
this.personalForm.salePersonId = val.id
|
||||
this.saleRepositoryId = val.repositoryName
|
||||
this.personalForm.repositoryName = val.repositoryId
|
||||
this.personalForm.saleRepositoryId = val.repositoryId
|
||||
this.roleId = val.postName
|
||||
this.personalForm.roleId = val.postId
|
||||
},
|
||||
|
@ -530,144 +573,151 @@ export default {
|
|||
this.customerId = null
|
||||
this.salePersonId = null
|
||||
},
|
||||
// // 保存操作
|
||||
// handlesave() {
|
||||
// const EnterDetail = this.$refs.editable.getRecords()
|
||||
// const EnterDetail2 = this.$refs.editable2.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.typeId === null || elem.typeId === '' || elem.typeId === undefined) {
|
||||
// delete elem.typeId
|
||||
// }
|
||||
// if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
|
||||
// delete elem.unit
|
||||
// }
|
||||
// if (elem.color === null || elem.color === '' || elem.color === undefined) {
|
||||
// delete elem.color
|
||||
// }
|
||||
// if (elem.performanceScore === null || elem.performanceScore === '' || elem.performanceScore === undefined) {
|
||||
// delete elem.performanceScore
|
||||
// }
|
||||
// if (elem.productScore === null || elem.productScore === '' || elem.productScore === undefined) {
|
||||
// delete elem.productScore
|
||||
// }
|
||||
// if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
|
||||
// delete elem.quantity
|
||||
// }
|
||||
// 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
|
||||
// }
|
||||
// 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 parms3 = JSON.stringify(EnterDetail2)
|
||||
// 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) {
|
||||
// createSaleReturn(parms, parms2, parms3, 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.editable2.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
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 保存操作
|
||||
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) {
|
||||
createsaleReturn(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)
|
||||
|
|
628
src/views/SaleReturn/SaleReturnList.vue
Normal file
628
src/views/SaleReturn/SaleReturnList.vue
Normal 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>
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<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-row>
|
||||
<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>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOrder.customerType')" prop="customerType" style="width: 100%;">
|
||||
<span>{{ personalForm.customerType | customerTypeFliter }}</span>
|
||||
<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('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>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOrder.invoiceType')" style="width: 100%;">
|
||||
<span>{{ personalForm.invoiceType | invoiceTypeFilter }}</span>
|
||||
<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('SaleOrder.payMode')" style="width: 100%;">
|
||||
<span>{{ personalForm.payMode | payModeFilter }}</span>
|
||||
<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('SaleOrder.transDate')" prop="transDate" 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%;">
|
||||
<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('SaleOrder.saleRepositoryId')" style="width: 100%;">
|
||||
<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('SaleOrder.roleId')" style="width: 100%;">
|
||||
<span>{{ personalForm.roleName }}</span>
|
||||
<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('SaleOrder.saleType')" style="width: 100%;">
|
||||
<span>{{ personalForm.saleTypeName }}</span>
|
||||
<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('SaleOrder.payType')" 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%;">
|
||||
<el-form-item :label="$t('SaleReturn.currency')" prop="currency" style="width: 100%;">
|
||||
<span>{{ personalForm.currency | currencyFilter }}</span>
|
||||
</el-form-item>
|
||||
</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-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>
|
||||
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">退货明细</h2>
|
||||
<div class="container">
|
||||
<el-editable
|
||||
ref="editable"
|
||||
|
@ -106,15 +90,16 @@
|
|||
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="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="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="performanceScore" align="center" label="绩效分" min-width="150px"/>
|
||||
<el-editable-column prop="productScore" align="center" label="商品积分" min-width="150px"/>
|
||||
<el-editable-column prop="quantity" 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"/>
|
||||
|
@ -126,31 +111,90 @@
|
|||
<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" 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="editable2"-->
|
||||
<!--:data.sync="list3"-->
|
||||
<!--:edit-config="{ showIcon: true, showStatus: true}"-->
|
||||
<!--:summary-method="getSummaries"-->
|
||||
<!--show-summary-->
|
||||
<!--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 prop="costName" align="center" label="费用名称" min-width="150px"/>-->
|
||||
<!--<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>-->
|
||||
<!--<el-editable-column prop="remark" 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>
|
||||
|
@ -226,7 +270,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { productlist } from '@/api/public'
|
||||
export default {
|
||||
filters: {
|
||||
currencyFilter(status) {
|
||||
|
@ -237,27 +280,27 @@ export default {
|
|||
return statusMap[status]
|
||||
},
|
||||
payTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '方式1',
|
||||
2: '方式2'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
payModeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '货到付款',
|
||||
2: '当场支付'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
invoiceTypeFilter(status) {
|
||||
closeStatusIdFilter(status) {
|
||||
const statusMap = {
|
||||
1: '无',
|
||||
2: '增值税'
|
||||
1: '已结算',
|
||||
2: '未结算'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
customerTypeFliter(status) {
|
||||
enterStatusIdFilter(status) {
|
||||
const statusMap = {
|
||||
1: '已入库',
|
||||
2: '未入库'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
customerTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '经销商',
|
||||
2: '零售商'
|
||||
|
@ -274,9 +317,8 @@ export default {
|
|||
},
|
||||
sourceTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '采购申请',
|
||||
2: '采购需求',
|
||||
3: '无来源'
|
||||
1: '销售出库单',
|
||||
2: '无来源'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
|
@ -321,63 +363,11 @@ export default {
|
|||
},
|
||||
detaildata() {
|
||||
this.personalForm = this.detaildata
|
||||
this.list2 = this.personalForm.stockPlanDetailVos
|
||||
this.list3 = this.personalForm.stockPlanDetailVos
|
||||
this.list2 = this.personalForm.saleReturnDetailVos
|
||||
this.reviewList = this.personalForm.approvalUseVos
|
||||
}
|
||||
},
|
||||
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() {
|
||||
this.editVisible = false
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<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-row>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
<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-option value="1" label="经销商"/>
|
||||
<el-option value="2" label="零售"/>
|
||||
|
@ -20,116 +33,78 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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"/>
|
||||
<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('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-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOrder.invoiceType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.invoiceType" style="margin-left: 18px;width: 200px">
|
||||
<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 invoiceTypes"
|
||||
v-for="(item, index) in colseTypes"
|
||||
:value="item.id"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
/>
|
||||
:label="item.categoryName"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOrder.payMode')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.payMode" style="margin-left: 18px;width: 200px">
|
||||
<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('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
|
||||
v-model="personalForm.transDate"
|
||||
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('SaleOrder.salePersonId')" prop="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('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-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-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-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--子件信息-->
|
||||
<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;">
|
||||
<el-button @click="handleAddproduct">添加商品</el-button>
|
||||
<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>
|
||||
|
@ -148,141 +123,98 @@
|
|||
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="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="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="performanceScore" align="center" label="绩效分" min-width="150px"/>
|
||||
<el-editable-column prop="productScore" 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="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.quantity"
|
||||
v-model="scope.row.returnQuantity"
|
||||
@change="getquantity(scope.row)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ gettaxprice(scope.row) }}</span>
|
||||
</template>
|
||||
</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-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" 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">
|
||||
<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('SaleOrder.heji1')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allQuantity" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji2')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji3')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allIncludeTaxMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji4')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allTaxMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji5')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allDiscountMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji6')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allIncludeTaxDiscountMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji7')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allIncludeTaxCostMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
<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('SaleOrder.heji8')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.allCostMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
</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 :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>
|
||||
|
@ -295,23 +227,23 @@
|
|||
<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('SaleOrder.backType')" prop="backType" style="width: 100%;">
|
||||
<el-select v-model="personalForm.backType" style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="是"/>
|
||||
<el-option value="2" label="否"/>
|
||||
<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('SaleOrder.backMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.backMoney" style="margin-left: 18px;width: 200px"/>
|
||||
<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('SaleOrder.sendType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.sendType" style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="已发货"/>
|
||||
<el-option value="2" label="未发货"/>
|
||||
<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>
|
||||
|
@ -329,18 +261,18 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { updatesaleOrder } from '@/api/SaleOrder'
|
||||
import { updatesaleReturn } from '@/api/SaleReturn'
|
||||
import { searchSaleCategory } from '@/api/SaleCategory'
|
||||
import { getlocation, locationlist } from '@/api/public'
|
||||
import MyEmp from './MyEmp'
|
||||
import MyDelivery from '../../DailyAdjust/components/MyDelivery'
|
||||
import MyDelivery from './MyDelivery'
|
||||
import MyDetail from './MyDetail'
|
||||
import MyApply from './MyApply'
|
||||
import MySupplier from '../../Product/components/MySupplier'
|
||||
import MyRequire from './MyRequire'
|
||||
import MyCustomer from './MyCustomer'
|
||||
import MyAgent from './MyAgent'
|
||||
export default {
|
||||
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
props: {
|
||||
editcontrol: {
|
||||
type: Boolean,
|
||||
|
@ -377,6 +309,14 @@ export default {
|
|||
heji7: '',
|
||||
heji8: '',
|
||||
heji9: '',
|
||||
// 货位数据
|
||||
locationlist: [],
|
||||
// 控制源单编码是否可以选择
|
||||
IsNumber: true,
|
||||
// 控制添加商品按钮是否可以点击
|
||||
Isproduct: true,
|
||||
// 回显门店
|
||||
saleRepositoryId: '',
|
||||
// 回显客户
|
||||
customerId: '',
|
||||
// 控制客户
|
||||
|
@ -386,21 +326,14 @@ export default {
|
|||
salePersonId: '',
|
||||
// 控制销售人员
|
||||
stockControl: false,
|
||||
// 开票类别数据
|
||||
invoiceTypes: [],
|
||||
// 开票类别获取参数
|
||||
invoicetypeparms: {
|
||||
type: 4,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 结算方式数据
|
||||
colseTypes: [],
|
||||
// 结算方式获取参数
|
||||
colseTypeparms: {
|
||||
type: 3,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
pagesize: 99999,
|
||||
iseffective: 1
|
||||
},
|
||||
// 控制商品列表窗口
|
||||
control: false,
|
||||
|
@ -412,14 +345,17 @@ export default {
|
|||
customerName: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
],
|
||||
transDate: [
|
||||
{ required: true, message: '请选择送货日期', trigger: 'change' }
|
||||
returnDate: [
|
||||
{ required: true, message: '请选择退货日期', trigger: 'change' }
|
||||
],
|
||||
salePersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
currency: [
|
||||
{ required: true, message: '请选择币种', trigger: 'change' }
|
||||
],
|
||||
backType: [
|
||||
{ required: true, message: '请选择回款状态', trigger: 'change' }
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
],
|
||||
closeStatusId: [
|
||||
{ required: true, message: '请选择结算状态', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 订单明细数据
|
||||
|
@ -437,17 +373,61 @@ export default {
|
|||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.planPersonId = this.personalForm.planPersonName
|
||||
this.stockPersonId = this.personalForm.stockPersonName
|
||||
this.list2 = this.personalForm.saleOrderDetailVos
|
||||
this.list3 = this.personalForm.saleOrderCostDetails
|
||||
this.chooseType()
|
||||
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
|
||||
|
@ -473,17 +453,24 @@ export default {
|
|||
}
|
||||
})
|
||||
sums[2] = ''
|
||||
sums[3] = ''
|
||||
sums[4] = ''
|
||||
sums[5] = ''
|
||||
sums[6] = ''
|
||||
sums[7] = ''
|
||||
sums[8] = ''
|
||||
sums[9] = ''
|
||||
this.heji1 = sums[10]
|
||||
this.heji2 = sums[18]
|
||||
this.heji3 = sums[15]
|
||||
this.heji4 = sums[17]
|
||||
this.heji5 = sums[21]
|
||||
this.heji6 = sums[15] - sums[21]
|
||||
this.heji7 = sums[19]
|
||||
this.heji8 = sums[14]
|
||||
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
|
||||
},
|
||||
// 通过折扣额计算折扣率
|
||||
|
@ -494,19 +481,19 @@ export default {
|
|||
getdiscount(row) {
|
||||
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(2)
|
||||
},
|
||||
// 通过数量计算成本金额, 含税金额, 金额, 含税成本金额
|
||||
getquantity(row) {
|
||||
row.costMoney = row.quantity * row.costPrice
|
||||
row.includeTaxMoney = row.quantity * row.taxprice
|
||||
row.money = row.quantity * row.salePrice
|
||||
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.quantity).toFixed(2)
|
||||
if (row.quantity !== 0) {
|
||||
row.taxRate = ((row.taxMoney / (row.salePrice * row.quantity)) * 100).toFixed(2)
|
||||
row.discount = (1 - row.discountMoney / row.salePrice / row.quantity).toFixed(2)
|
||||
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.quantity * (1 - row.discount)).toFixed(2)
|
||||
return row.quantity
|
||||
row.discountMoney = (row.salePrice * row.returnQuantity * (1 - row.discount)).toFixed(2)
|
||||
return row.returnQuantity
|
||||
},
|
||||
// 计算含税价
|
||||
gettaxprice(row) {
|
||||
|
@ -577,20 +564,6 @@ export default {
|
|||
updatecountry() {
|
||||
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事件
|
||||
handlechooseStock() {
|
||||
this.stockControl = true
|
||||
|
@ -599,6 +572,10 @@ export default {
|
|||
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() {
|
||||
|
@ -620,7 +597,6 @@ export default {
|
|||
this.personalForm.countryId = 1
|
||||
this.personalForm.modifyPersonId = 3
|
||||
const EnterDetail = this.$refs.editable.getRecords()
|
||||
const EnterDetail2 = this.$refs.editable2.getRecords()
|
||||
if (EnterDetail.length === 0) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
|
@ -632,29 +608,29 @@ export default {
|
|||
EnterDetail.map(function(elem) {
|
||||
return elem
|
||||
}).forEach(function(elem) {
|
||||
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
|
||||
delete elem.productCode
|
||||
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.typeId === null || elem.typeId === '' || elem.typeId === undefined) {
|
||||
delete elem.typeId
|
||||
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.performanceScore === null || elem.performanceScore === '' || elem.performanceScore === undefined) {
|
||||
delete elem.performanceScore
|
||||
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
|
||||
delete elem.kpiGrade
|
||||
}
|
||||
if (elem.productScore === null || elem.productScore === '' || elem.productScore === undefined) {
|
||||
delete elem.productScore
|
||||
}
|
||||
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
|
||||
delete elem.quantity
|
||||
if (elem.point === null || elem.point === '' || elem.point === undefined) {
|
||||
delete elem.point
|
||||
}
|
||||
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
|
||||
delete elem.salePrice
|
||||
|
@ -692,24 +668,33 @@ export default {
|
|||
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
|
||||
delete elem.discountMoney
|
||||
}
|
||||
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.alreadyReturnQuantity === null || elem.alreadyReturnQuantity === '' || elem.alreadyReturnQuantity === undefined) {
|
||||
delete elem.alreadyReturnQuantity
|
||||
}
|
||||
if (elem.money === null || elem.money === '' || elem.money === undefined) {
|
||||
delete elem.money
|
||||
if (elem.returnQuantity === null || elem.returnQuantity === '' || elem.returnQuantity === undefined) {
|
||||
delete elem.returnQuantity
|
||||
}
|
||||
if (elem.remark === null || elem.remark === '' || elem.remark === undefined) {
|
||||
delete elem.remark
|
||||
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 parms3 = JSON.stringify(EnterDetail2)
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -717,7 +702,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatesaleOrder(parms, parms2, parms3).then(res => {
|
||||
updatesaleReturn(parms, parms2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
|
@ -728,7 +713,6 @@ export default {
|
|||
})
|
||||
this.$emit('rest', true)
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.editVisible = false
|
||||
|
@ -743,7 +727,6 @@ export default {
|
|||
},
|
||||
handlecancel() {
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.editVisible = false
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('StockApply.applyPersonId')" style="width: 100%;">
|
||||
<el-input v-model="applyPersonId" style="margin-left: 18px" clearable @focus="handlechooseStock"/>
|
||||
<el-form-item :label="$t('StockApply.applyPersonId')" prop="applyPersonId" style="width: 100%;">
|
||||
<el-input v-model="applyPersonId" style="margin-left: 18px" @focus="handlechooseStock"/>
|
||||
<my-emp :control.sync="stockControl" @stockName="stockName"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -44,6 +44,7 @@
|
|||
<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-option value="1" label="无来源" />
|
||||
<el-option value="2" label="销售订单" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -52,6 +53,7 @@
|
|||
<el-date-picker
|
||||
v-model="personalForm.applyDate"
|
||||
type="date"
|
||||
default-value
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px"/>
|
||||
</el-form-item>
|
||||
|
@ -87,9 +89,10 @@
|
|||
<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="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: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" 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="requireQuantity" 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 prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -112,8 +115,18 @@
|
|||
<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="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: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="planQuantity" 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">
|
||||
<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>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -136,6 +149,14 @@ export default {
|
|||
name: 'AddStockApply',
|
||||
components: { MyDetail, MyEmp },
|
||||
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 {
|
||||
// 选择的数据
|
||||
choosedata: [],
|
||||
|
@ -164,6 +185,9 @@ export default {
|
|||
},
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
applyPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
stockType: [
|
||||
{ required: true, message: '请选择采购类别', trigger: 'change' }
|
||||
],
|
||||
|
@ -171,7 +195,7 @@ export default {
|
|||
{ required: true, message: '请选择申请日期', trigger: 'change' }
|
||||
],
|
||||
applyDeptId: [
|
||||
{ required: true, message: '请选择申请部门', trigger: 'change' }
|
||||
{ required: true, message: '请选择申请部门', trigger: 'none' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
|
@ -183,13 +207,33 @@ export default {
|
|||
list3: [],
|
||||
// 采购申请单明细列表规则
|
||||
validRules: {
|
||||
requireQuantity: [
|
||||
{ required: true, message: '请输入需求数量', trigger: 'change' }
|
||||
],
|
||||
requireDate: [
|
||||
{ required: true, message: '请选择需求日期', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
this.getdatatime()
|
||||
},
|
||||
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() {
|
||||
this.$refs.editable.removeSelecteds()
|
||||
|
@ -207,6 +251,10 @@ export default {
|
|||
deleteChange(val) {
|
||||
this.choosedata = val
|
||||
},
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 更新类型
|
||||
updatecountry() {
|
||||
this.getTypes()
|
||||
|
@ -231,8 +279,10 @@ export default {
|
|||
},
|
||||
// 申请人回显
|
||||
stockName(val) {
|
||||
console.log(val)
|
||||
this.applyPersonId = val.personName
|
||||
this.personalForm.applyPersonId = val.id
|
||||
this.personalForm.applyDeptId = val.deptId
|
||||
},
|
||||
// 采购申请明细来源
|
||||
handleAddproduct() {
|
||||
|
@ -349,27 +399,31 @@ export default {
|
|||
const parms = JSON.stringify(Data)
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
addstockapply(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.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
addstockapply(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.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(valid => {
|
||||
console.log('error submit!!')
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
|
|
|
@ -264,10 +264,11 @@ export default {
|
|||
productCode: item.code,
|
||||
productName: item.productName,
|
||||
typeId: item.typeId,
|
||||
requireQuantity: 0,
|
||||
requireQuantity: 1.00,
|
||||
color: item.color,
|
||||
unit: item.purMeasu,
|
||||
productType: item.productType
|
||||
productType: item.productType,
|
||||
planQuantity: '0.00'
|
||||
}
|
||||
})
|
||||
const productDetail2 = this.moreaction.map(function(item) {
|
||||
|
@ -278,7 +279,7 @@ export default {
|
|||
color: item.color,
|
||||
unit: item.purMeasu,
|
||||
productType: item.productType,
|
||||
applyQuantity: 0,
|
||||
applyQuantity: '0.00',
|
||||
planQuantity: 0
|
||||
}
|
||||
})
|
||||
|
|
|
@ -23,14 +23,14 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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"/>
|
||||
<my-emp :control.sync="stockControl" @stockName="stockName"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -43,6 +43,7 @@
|
|||
<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-option value="1" label="无来源" />
|
||||
<el-option value="2" label="销售订单" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -86,13 +87,14 @@
|
|||
<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="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: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="requireDate" align="center" label="需求日期" min-width="180px"/>
|
||||
<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', 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 prop="sourceSerialNumber" align="center" label="源单编号" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</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>
|
||||
<div class="container">
|
||||
<el-editable
|
||||
|
@ -111,8 +113,18 @@
|
|||
<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="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: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="planQuantity" 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">
|
||||
<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>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -144,6 +156,14 @@ export default {
|
|||
}
|
||||
},
|
||||
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 {
|
||||
// 选择的数据
|
||||
choosedata: [],
|
||||
|
@ -168,6 +188,9 @@ export default {
|
|||
control: false,
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
applyPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
stockType: [
|
||||
{ required: true, message: '请选择采购类别', trigger: 'change' }
|
||||
],
|
||||
|
@ -175,7 +198,7 @@ export default {
|
|||
{ required: true, message: '请选择申请日期', trigger: 'change' }
|
||||
],
|
||||
applyDeptId: [
|
||||
{ required: true, message: '请选择申请部门', trigger: 'change' }
|
||||
{ required: true, message: '请选择申请部门', trigger: 'none' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
|
@ -187,6 +210,12 @@ export default {
|
|||
list3: [],
|
||||
// 采购申请单明细列表规则
|
||||
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.list2 = this.personalForm.stockApplyDetailVos
|
||||
this.list3 = this.personalForm.stockApplyDetailVos
|
||||
this.getdatatime()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
},
|
||||
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() {
|
||||
this.$refs.editable.removeSelecteds()
|
||||
|
@ -222,6 +265,10 @@ export default {
|
|||
deleteChange(val) {
|
||||
this.choosedata = val
|
||||
},
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 更新类型
|
||||
updatecountry() {
|
||||
this.getTypes()
|
||||
|
@ -248,6 +295,7 @@ export default {
|
|||
stockName(val) {
|
||||
this.applyPersonId = val.personName
|
||||
this.personalForm.applyPersonId = val.id
|
||||
this.personalForm.applyDeptId = val.deptId
|
||||
},
|
||||
// 采购申请明细来源
|
||||
handleAddproduct() {
|
||||
|
@ -368,27 +416,42 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatestockapply(parms, parms2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
updatestockapply(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.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 {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -416,6 +479,7 @@ export default {
|
|||
}
|
||||
.edit >>> .el-dialog {
|
||||
background:#f1f1f1 ;
|
||||
height: auto;
|
||||
}
|
||||
.el-col-12{
|
||||
width: 49%;
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail"/>
|
||||
<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>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -152,11 +152,27 @@
|
|||
<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="taxRate" align="center" label="税率(%)" min-width="170px"/>
|
||||
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
|
||||
<el-editable-column prop="includeTaxMoney" 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">
|
||||
<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="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="sourceNumber" 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 :span="6">
|
||||
<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-col>
|
||||
</el-row>
|
||||
|
@ -363,6 +379,8 @@ export default {
|
|||
sums[4] = ''
|
||||
sums[5] = ''
|
||||
sums[6] = ''
|
||||
sums[8] = ''
|
||||
sums[9] = ''
|
||||
sums[10] = ''
|
||||
sums[15] = ''
|
||||
sums[18] = ''
|
||||
|
@ -375,6 +393,25 @@ export default {
|
|||
this.allMoneyMoveDiscount = sums[13] - sums[16]
|
||||
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() {
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
|
@ -421,6 +458,7 @@ export default {
|
|||
allOrderinfo(val) {
|
||||
this.personalForm.supplierId = val.supplierId
|
||||
this.supplierId = val.supplierName
|
||||
this.allOthermoney = val.otherMoney
|
||||
},
|
||||
// 更新类型
|
||||
updatecountry() {
|
||||
|
@ -561,6 +599,9 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
|
|
|
@ -152,12 +152,32 @@
|
|||
<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="includeTaxPrice" 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="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
|
||||
<el-editable-column prop="taxMoney" align="center" label="税额" min-width="150px"/>
|
||||
<el-editable-column prop="taxRate" align="center" label="税率(%)" min-width="170px">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ gettaxRate(scope.row) }}</p>
|
||||
</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="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="sourceNumber" 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]
|
||||
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() {
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
|
|
|
@ -363,11 +363,11 @@ export default {
|
|||
giveDate: item.deliveryDate,
|
||||
price: item.price,
|
||||
includeTaxPrice: item.includeTaxPrice,
|
||||
taxRate: item.taxRate,
|
||||
taxRate: item.taxRate * 100,
|
||||
money: item.money,
|
||||
includeTaxMoney: item.includeTaxMoney,
|
||||
taxMoney: item.tax,
|
||||
discountRate: item.discountRate,
|
||||
discountRate: item.discountRate * 100,
|
||||
discountMoney: item.discountMoney,
|
||||
remark: item.remarks,
|
||||
sourceNumber: number,
|
||||
|
|
|
@ -24,13 +24,13 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -300,9 +300,25 @@ export default {
|
|||
components: { MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.supplierId)
|
||||
if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
|
@ -367,10 +383,13 @@ export default {
|
|||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
inquiryPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
],
|
||||
stockPersonId: [
|
||||
{ required: true, validator: validatePass3, trigger: 'change' }
|
||||
],
|
||||
inquiryDate: [
|
||||
{ required: true, message: '请选择询价日期', trigger: 'change' }
|
||||
|
@ -411,7 +430,7 @@ export default {
|
|||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
return (prev + curr).toFixed(2)
|
||||
} else {
|
||||
return (prev).toFixed(2)
|
||||
}
|
||||
|
@ -479,31 +498,34 @@ export default {
|
|||
},
|
||||
// 通过税率计算含税价
|
||||
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) {
|
||||
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)
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
|
||||
},
|
||||
// 计算税额
|
||||
getTaxMoney2(row) {
|
||||
row.taxMoney = row.price * row.taxRate * row.plannedQuantity
|
||||
row.taxMoney = (row.price * row.taxRate / 100 * row.plannedQuantity).toFixed(2)
|
||||
return row.taxMoney
|
||||
},
|
||||
// 计算含税金额
|
||||
getTaxMoney(row) {
|
||||
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice
|
||||
row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
|
||||
return row.includeTaxMoney
|
||||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.plannedQuantity * row.price
|
||||
row.money = (row.plannedQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
|
|
|
@ -497,31 +497,34 @@ export default {
|
|||
},
|
||||
// 通过税率计算含税价
|
||||
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) {
|
||||
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)
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
|
||||
},
|
||||
// 计算税额
|
||||
getTaxMoney2(row) {
|
||||
row.taxMoney = row.price * row.taxRate * row.plannedQuantity
|
||||
row.taxMoney = (row.price * row.taxRate / 100 * row.plannedQuantity).toFixed(2)
|
||||
return row.taxMoney
|
||||
},
|
||||
// 计算含税金额
|
||||
getTaxMoney(row) {
|
||||
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice
|
||||
row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
|
||||
return row.includeTaxMoney
|
||||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.plannedQuantity * row.price
|
||||
row.money = (row.plannedQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
|
@ -755,6 +758,9 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
|
|
|
@ -23,19 +23,19 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
|
@ -46,7 +46,7 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -66,7 +66,7 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
|
@ -94,10 +94,10 @@
|
|||
<h2 ref="fuzhu" class="form-name" >采购询价单明细</h2>
|
||||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<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>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" @plan="plan"/>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allinfo="allinfo"/>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -118,11 +118,27 @@
|
|||
<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="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: '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">
|
||||
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="170px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<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"
|
||||
@input="getprice(scope.row)"/>
|
||||
</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">
|
||||
<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, 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">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ getMoney(scope.row) }}</p>
|
||||
|
@ -180,14 +204,30 @@ export default {
|
|||
components: { MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.supplierId)
|
||||
if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
// 控制明细中计划数量是否可以编辑
|
||||
IsPlannedQuantity: false,
|
||||
// 控制采购类别是否可以编辑
|
||||
IsStockTypeId: false,
|
||||
// 控制部门是否可以编辑
|
||||
IsDeptId: false,
|
||||
// 传递的部门id
|
||||
supp: null,
|
||||
// 控制源单为采购计划时
|
||||
plancontrol: false,
|
||||
// 控制源单为采购申请时
|
||||
|
@ -223,15 +263,17 @@ export default {
|
|||
countryId: 1,
|
||||
repositoryId: 438,
|
||||
regionId: 2,
|
||||
isVat: 1
|
||||
isVat: 1,
|
||||
inquiryTimes: 1,
|
||||
currency: '1'
|
||||
},
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
inquiryPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
],
|
||||
inquiryDate: [
|
||||
{ required: true, message: '请选择询价日期', trigger: 'change' }
|
||||
|
@ -250,26 +292,43 @@ export default {
|
|||
list2: [],
|
||||
// 采购申请单明细列表规则
|
||||
validRules: {
|
||||
planDeliveryDate: [
|
||||
{ required: true, message: '请选择交货日期', trigger: 'change' }
|
||||
],
|
||||
plannedQuantity: [
|
||||
{ required: true, message: '请输入计划数量', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
this.getdatatime()
|
||||
},
|
||||
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) {
|
||||
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) {
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate)).toFixed(2)
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
|
||||
},
|
||||
// 计算税额
|
||||
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
|
||||
},
|
||||
// 计算含税金额
|
||||
|
@ -279,22 +338,36 @@ export default {
|
|||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.plannedQuantity * row.price
|
||||
row.money = (row.plannedQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
chooseType() {
|
||||
console.log(this.personalForm.sourceType)
|
||||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
|
||||
if (this.personalForm.sourceType === '1') {
|
||||
this.addsouce = false
|
||||
this.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
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 === '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') {
|
||||
this.addpro = false
|
||||
this.addsouce = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.IsStockTypeId = false
|
||||
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') {
|
||||
this.applycontrol = true
|
||||
} 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
|
||||
}
|
||||
},
|
||||
// 采购申请加载过来数据
|
||||
apply(val) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = true
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
|
@ -323,10 +405,20 @@ export default {
|
|||
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) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = true
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
const quchonggong = this.personalForm.supplierId
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
if (val[i].productCode === nowlistdata[j].productCode) {
|
||||
|
@ -338,6 +430,9 @@ export default {
|
|||
return false
|
||||
}
|
||||
}
|
||||
if (val[i].supplierId !== quchonggong) {
|
||||
continue
|
||||
}
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
|
@ -365,9 +460,9 @@ export default {
|
|||
},
|
||||
// 供应商列表返回数据
|
||||
supplierName(val) {
|
||||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.supplierId = val.id
|
||||
this.supp = val.id
|
||||
},
|
||||
// 询价员focus事件
|
||||
handlechooseStock() {
|
||||
|
@ -380,10 +475,19 @@ export default {
|
|||
},
|
||||
// 采购申请明细来源
|
||||
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
|
||||
},
|
||||
productdetail(val) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = false
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
console.log(val[i].price)
|
||||
|
@ -468,9 +572,15 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
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) {
|
||||
delete elem.money
|
||||
}
|
||||
|
@ -492,26 +602,30 @@ export default {
|
|||
const parms = JSON.stringify(Data)
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
createstockInquiry(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()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
createstockInquiry(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()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(valid => {
|
||||
console.log('error submit!!')
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column :label="$t('StockInquiry.stockTypeId')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.stockTypeId | stockTypeFilter }}</span>
|
||||
<span>{{ scope.row.stockTypeName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('StockInquiry.sourceType')" :resizable="false" align="center" min-width="150">
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
import { stocapplylist } from '@/api/StockApply'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import { productlist } from '@/api/public'
|
||||
// import { productlist } from '@/api/public'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination'
|
||||
import MyEmp from '../../StockApply/components/MyEmp'
|
||||
|
@ -320,6 +320,7 @@ export default {
|
|||
// 确认添加数据
|
||||
async handleConfirm() {
|
||||
this.employeeVisible = false
|
||||
console.log(this.choosedata)
|
||||
const applydata = this.choosedata.stockApplyDetailVos
|
||||
const number = this.choosedata.applyNumber
|
||||
const applyDetail = applydata.map(function(item) {
|
||||
|
@ -331,7 +332,7 @@ export default {
|
|||
type: item.typeId,
|
||||
unit: item.unit,
|
||||
color: item.color,
|
||||
plannedQuantity: item.planQuantity,
|
||||
plannedQuantity: item.requireQuantity,
|
||||
planDeliveryDate: item.requireDate,
|
||||
applicationReason: item.applyReason,
|
||||
sourceNumber: number,
|
||||
|
@ -339,23 +340,9 @@ export default {
|
|||
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('apply2', applyDetail)
|
||||
this.$emit('allinfo', this.choosedata)
|
||||
this.$emit('allapplyinfo', this.choosedata)
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<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: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -173,6 +177,7 @@ export default {
|
|||
typeid: '',
|
||||
isactive: '',
|
||||
Productid: '',
|
||||
supplierid: this.supp,
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
}
|
||||
|
@ -182,7 +187,11 @@ export default {
|
|||
control() {
|
||||
this.productVisible = this.control
|
||||
console.log(this.control)
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierid = this.supp
|
||||
this.getlist()
|
||||
console.log(this.supp)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
|
@ -45,7 +45,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -65,7 +65,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
|
@ -93,10 +93,10 @@
|
|||
<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;">
|
||||
<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>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" @plan="plan"/>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allinfo="allinfo"/>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -114,25 +114,61 @@
|
|||
<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="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="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: 'ElDatePicker', attrs: {type: 'date', format: 'yyyy-MM-dd'}, type: 'visible'}" prop="planDeliveryDate" align="center" label="交货日期" min-width="160px"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" label="单价" min-width="150px"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="includeTaxPrice" 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"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 1, precision: 2}, type: 'visible'}" prop="plannedQuantity" align="center" label="计划数量" min-width="170px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<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"
|
||||
@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">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ getMoney(scope.row) }}</p>
|
||||
</template>
|
||||
</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">
|
||||
<p>{{ getTaxMoney(scope.row) }}</p>
|
||||
</template>
|
||||
</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">
|
||||
<p>{{ getTaxMoney2(scope.row) }}</p>
|
||||
</template>
|
||||
|
@ -176,14 +212,30 @@ export default {
|
|||
},
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.supplierId)
|
||||
if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
// 控制明细中计划数量是否可以编辑
|
||||
IsPlannedQuantity: false,
|
||||
// 控制采购类别是否可以编辑
|
||||
IsStockTypeId: false,
|
||||
// 控制部门是否可以编辑
|
||||
IsDeptId: false,
|
||||
// 传递的部门id
|
||||
supp: null,
|
||||
// 选择的数据
|
||||
choosedata: [],
|
||||
// 弹窗组件的控制
|
||||
|
@ -220,10 +272,10 @@ export default {
|
|||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
inquiryPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
],
|
||||
inquiryDate: [
|
||||
{ required: true, message: '请选择询价日期', trigger: 'change' }
|
||||
|
@ -242,6 +294,12 @@ export default {
|
|||
list2: [],
|
||||
// 采购申请单明细列表规则
|
||||
validRules: {
|
||||
planDeliveryDate: [
|
||||
{ required: true, message: '请选择交货日期', trigger: 'change' }
|
||||
],
|
||||
plannedQuantity: [
|
||||
{ required: true, message: '请输入计划数量', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -261,34 +319,65 @@ export default {
|
|||
this.getTypes()
|
||||
},
|
||||
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) {
|
||||
row.taxMoney = row.price * row.taxRate
|
||||
row.taxMoney = (row.price * (row.taxRate / 100) * row.plannedQuantity).toFixed(2)
|
||||
return row.taxMoney
|
||||
},
|
||||
// 计算含税金额
|
||||
getTaxMoney(row) {
|
||||
row.includeTaxMoney = row.plannedQuantity * row.includeTaxPrice
|
||||
row.includeTaxMoney = (row.plannedQuantity * row.includeTaxPrice).toFixed(2)
|
||||
return row.includeTaxMoney
|
||||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.plannedQuantity * row.price
|
||||
row.money = (row.plannedQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
chooseType() {
|
||||
console.log(this.personalForm.sourceType)
|
||||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
|
||||
if (this.personalForm.sourceType === '1') {
|
||||
this.addsouce = false
|
||||
this.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
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 === '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') {
|
||||
this.addpro = false
|
||||
this.addsouce = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.IsStockTypeId = false
|
||||
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') {
|
||||
this.applycontrol = true
|
||||
} 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
|
||||
}
|
||||
},
|
||||
// 采购申请加载过来数据
|
||||
apply(val) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = true
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
|
@ -317,9 +415,19 @@ export default {
|
|||
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) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = true
|
||||
const quchonggong = this.personalForm.supplierId
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
|
@ -332,6 +440,9 @@ export default {
|
|||
return false
|
||||
}
|
||||
}
|
||||
if (val[i].supplierId !== quchonggong) {
|
||||
continue
|
||||
}
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
|
@ -362,6 +473,7 @@ export default {
|
|||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.supplierId = val.id
|
||||
this.supp = val.id
|
||||
},
|
||||
// 询价员focus事件
|
||||
handlechooseStock() {
|
||||
|
@ -374,10 +486,19 @@ export default {
|
|||
},
|
||||
// 采购申请明细来源
|
||||
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
|
||||
},
|
||||
productdetail(val) {
|
||||
console.log(val)
|
||||
this.IsPlannedQuantity = false
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
console.log(val[i].price)
|
||||
|
@ -468,9 +589,15 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
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) {
|
||||
delete elem.money
|
||||
}
|
||||
|
@ -490,26 +617,41 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatestockInquiry(parms, parms2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
updatestockInquiry(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
|
||||
})
|
||||
}
|
||||
})
|
||||
}).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 {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -536,6 +678,7 @@ export default {
|
|||
}
|
||||
.edit >>> .el-dialog {
|
||||
background:#f1f1f1 ;
|
||||
height: 900px;
|
||||
}
|
||||
.el-col-12{
|
||||
width: 49%;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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-row>
|
||||
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
|
||||
|
@ -181,6 +181,10 @@ export default {
|
|||
plancontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -228,6 +232,7 @@ export default {
|
|||
pageSize: 10,
|
||||
repositoryId: 438,
|
||||
regionIds: 2,
|
||||
supplierId: this.supp,
|
||||
createPersonId: 3
|
||||
},
|
||||
// 传给组件的数据
|
||||
|
@ -241,6 +246,11 @@ export default {
|
|||
watch: {
|
||||
plancontrol() {
|
||||
this.employeeVisible = this.plancontrol
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierId = this.supp
|
||||
this.getlist()
|
||||
console.log(this.supp)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -332,7 +342,8 @@ export default {
|
|||
sourceNumber: number,
|
||||
sourceSerialNumber: item.id,
|
||||
price: item.basicPrice,
|
||||
includeTaxPrice: item.basicPrice
|
||||
includeTaxPrice: item.basicPrice,
|
||||
supplierId: item.supplierId
|
||||
}
|
||||
})
|
||||
console.log(applyDetail)
|
||||
|
|
|
@ -25,19 +25,19 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
|
@ -48,7 +48,7 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -59,29 +59,30 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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
|
||||
v-model="personalForm.orderDate"
|
||||
: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('StockOrder.signPersonId')" style="width: 100%;">
|
||||
<el-input v-model="signPersonId" style="margin-left: 18px" clearable @focus="handlechooseDelivery"/>
|
||||
<el-form-item :label="$t('StockOrder.signPersonId')" prop="signPersonId" style="width: 100%;">
|
||||
<el-input v-model="signPersonId" :disabled="IsSignPersonId" style="margin-left: 18px;width: 218px" @focus="handlechooseDelivery"/>
|
||||
</el-form-item>
|
||||
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
|
@ -93,7 +94,7 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
|
@ -113,12 +114,17 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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="2" label="USD"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form>
|
||||
</div>
|
||||
|
@ -128,12 +134,12 @@
|
|||
<h2 ref="fuzhu" class="form-name" >采购订单明细</h2>
|
||||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<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>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" @plan="plan" @allPlaninfo="allPlaninfo"/>
|
||||
<my-lnquiry :inquirycontrol.sync="inquirycontrol" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
|
||||
<my-contract :contractcontrol.sync="contractcontrol" @contract="contract" @allcontractinfo="allcontractinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allPlaninfo="allPlaninfo"/>
|
||||
<my-lnquiry :inquirycontrol.sync="inquirycontrol" :supp.sync="supp" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
|
||||
<my-contract :contractcontrol.sync="contractcontrol" :supp.sync="supp" @contract="contract" @allcontractinfo="allcontractinfo"/>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -155,10 +161,11 @@
|
|||
<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="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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.price"
|
||||
@input="getprice(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.includeTaxPrice"
|
||||
@input="getincludeTaxPrice(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.taxRate"
|
||||
@input="gettaxRate(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.discountRate"
|
||||
@input="getdiscountRate(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.discountMoney"
|
||||
@input="getdiscountMoney(scope.row)"/>
|
||||
</template>
|
||||
|
@ -250,7 +261,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
|
@ -286,14 +297,63 @@ export default {
|
|||
components: { MyContract, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.supplierId)
|
||||
if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
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: '',
|
||||
allMoney: '',
|
||||
|
@ -351,21 +411,26 @@ export default {
|
|||
countryId: 1,
|
||||
repositoryId: 438,
|
||||
regionId: 2,
|
||||
isVat: 1
|
||||
isVat: 1,
|
||||
sourceType: '5',
|
||||
currency: '1'
|
||||
},
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
signPersonId: [
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
],
|
||||
stockPersonId: [
|
||||
{ required: true, validator: validatePass3, trigger: 'change' }
|
||||
],
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
inquiryPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
],
|
||||
inquiryDate: [
|
||||
orderDate: [
|
||||
{ required: true, message: '请选择询价日期', trigger: 'change' }
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: '请选择部门', trigger: 'change' }
|
||||
{ required: true, validator: validatePass4, trigger: 'change' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
|
@ -378,14 +443,29 @@ export default {
|
|||
list2: [],
|
||||
// 采购申请单明细列表规则
|
||||
validRules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'change' }
|
||||
],
|
||||
stockQuantity: [
|
||||
{ required: true, message: '请输入采购数量', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
this.chooseType()
|
||||
this.getways()
|
||||
this.getdatatime()
|
||||
},
|
||||
methods: {
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getdatatime() { // 默认显示今天
|
||||
this.personalForm.orderDate = new Date()
|
||||
},
|
||||
// 总计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
|
@ -400,9 +480,9 @@ export default {
|
|||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
return (Number(prev) + Number(curr)).toFixed(2)
|
||||
} else {
|
||||
return (prev).toFixed(2)
|
||||
return (Number(prev)).toFixed(2)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ''
|
||||
|
@ -414,21 +494,21 @@ export default {
|
|||
sums[3] = ''
|
||||
sums[4] = ''
|
||||
sums[5] = ''
|
||||
sums[6] = ''
|
||||
sums[7] = ''
|
||||
sums[8] = ''
|
||||
sums[9] = ''
|
||||
sums[10] = ''
|
||||
sums[13] = ''
|
||||
sums[14] = ''
|
||||
sums[15] = ''
|
||||
sums[16] = ''
|
||||
sums[17] = ''
|
||||
sums[18] = ''
|
||||
sums[19] = ''
|
||||
this.allNumber = sums[7]
|
||||
this.allMoney = sums[11]
|
||||
this.allTaxMoney = sums[13]
|
||||
this.allIncludeTaxMoney = sums[12]
|
||||
this.allDiscountMoney = sums[16]
|
||||
this.allMoneyMoveDiscount = sums[12] - sums[16]
|
||||
this.allNumber = sums[6]
|
||||
this.allMoney = sums[10]
|
||||
this.allTaxMoney = sums[12]
|
||||
this.allIncludeTaxMoney = sums[11]
|
||||
this.allDiscountMoney = sums[15]
|
||||
this.allMoneyMoveDiscount = sums[11] - sums[15]
|
||||
return sums
|
||||
},
|
||||
getways() {
|
||||
|
@ -468,57 +548,152 @@ export default {
|
|||
},
|
||||
// 通过税率计算含税价
|
||||
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) {
|
||||
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)).toFixed(2)
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
|
||||
},
|
||||
// 计算税额
|
||||
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
|
||||
},
|
||||
// 计算含税金额
|
||||
getTaxMoney(row) {
|
||||
row.includeTaxMoney = row.stockQuantity * row.includeTaxPrice
|
||||
row.includeTaxMoney = (row.stockQuantity * row.includeTaxPrice).toFixed(2)
|
||||
return row.includeTaxMoney
|
||||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.stockQuantity * row.price
|
||||
row.money = (row.stockQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
chooseType() {
|
||||
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.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.addpro = false
|
||||
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') {
|
||||
this.addpro = false
|
||||
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() {
|
||||
console.log(this.personalForm.supplierId)
|
||||
if (this.personalForm.sourceType === '1') {
|
||||
this.applycontrol = true
|
||||
} 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
|
||||
} 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
|
||||
} 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
|
||||
}
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
},
|
||||
// 采购合同加载过来数据
|
||||
contract(val) {
|
||||
|
@ -539,8 +714,7 @@ export default {
|
|||
}
|
||||
},
|
||||
allcontractinfo(val) {
|
||||
this.personalForm.supplierId = val.supplierId
|
||||
this.supplierId = val.supplierName
|
||||
console.log(val)
|
||||
this.stockPersonId = val.stockPersonName
|
||||
this.personalForm.stockPersonId = val.stockPersonId
|
||||
this.personalForm.stockType = val.stockType
|
||||
|
@ -572,16 +746,15 @@ export default {
|
|||
}
|
||||
},
|
||||
allLnquirinfo(val) {
|
||||
this.personalForm.supplierId = val.supplierId
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.stockType = val.stockTypeId
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockTypeId
|
||||
this.personalForm.deptId = val.deptId
|
||||
this.personalForm.isVat = val.isVat
|
||||
searchsupplier(val.supplierName).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
console.log(res)
|
||||
this.personalForm.deliveryMode = res.data.data.content.list[0].giveId
|
||||
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()
|
||||
})
|
||||
|
@ -606,13 +779,15 @@ export default {
|
|||
}
|
||||
},
|
||||
allapplyinfo(val) {
|
||||
this.personalForm.stockType = val.stockType
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockType
|
||||
this.personalForm.deptId = val.applyDeptId
|
||||
},
|
||||
// 采购计划加载过来数据
|
||||
plan(val) {
|
||||
console.log(val)
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
const quchonggong = this.personalForm.supplierId
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
if (val[i].productCode === nowlistdata[j].productCode) {
|
||||
|
@ -624,13 +799,20 @@ export default {
|
|||
return false
|
||||
}
|
||||
}
|
||||
if (val[i].supplierId !== quchonggong) {
|
||||
console.log(1234)
|
||||
continue
|
||||
}
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
allPlaninfo(val) {
|
||||
this.personalForm.stockType = val.stockType
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockType
|
||||
this.personalForm.deptId = val.stockDeptId
|
||||
this.personalForm.isVat = val.isVat
|
||||
this.stockPersonId = val.stockPersonName
|
||||
this.personalForm.stockPersonId = val.stockPersonId
|
||||
},
|
||||
// 更新类型
|
||||
updatecountry() {
|
||||
|
@ -659,6 +841,8 @@ export default {
|
|||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.supplierId = val.id
|
||||
this.supp = val.id
|
||||
this.$refs.editable.clear()
|
||||
},
|
||||
// 采购员focus事件
|
||||
handlechooseStock() {
|
||||
|
@ -679,6 +863,14 @@ export default {
|
|||
},
|
||||
// 采购申请明细来源
|
||||
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
|
||||
},
|
||||
productdetail(val) {
|
||||
|
@ -755,6 +947,9 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
|
@ -788,26 +983,30 @@ export default {
|
|||
const parms = JSON.stringify(Data)
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
addstockorder(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()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
addstockorder(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()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(valid => {
|
||||
console.log('error submit!!')
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
|
|
|
@ -369,6 +369,9 @@ export default {
|
|||
if (row.currency !== null) {
|
||||
this.personalForm.currency = String(row.currency)
|
||||
}
|
||||
if (row.payMode !== null) {
|
||||
this.personalForm.payMode = String(row.payMode)
|
||||
}
|
||||
},
|
||||
// 修改组件修改成功后返回
|
||||
refreshlist(val) {
|
||||
|
|
|
@ -59,6 +59,11 @@
|
|||
<span>{{ personalForm.currency | currencyFilter }}</span>
|
||||
</el-form-item>
|
||||
</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-form>
|
||||
</div>
|
||||
|
@ -87,24 +92,14 @@
|
|||
<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="taxRate" align="center" label="税率" min-width="150px"/>
|
||||
<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="money" align="center" label="金额" min-width="150px"/>
|
||||
<el-editable-column prop="includeTaxMoney" align="center" label="含税金额" min-width="150px"/>
|
||||
<el-editable-column prop="taxMoney" 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="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>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -257,21 +252,6 @@ export default {
|
|||
}
|
||||
},
|
||||
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() {
|
||||
this.editVisible = false
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
import { stocapplylist } from '@/api/StockApply'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import { productlist } from '@/api/public'
|
||||
// import { productlist } from '@/api/public'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination'
|
||||
import MyEmp from '../../StockApply/components/MyEmp'
|
||||
|
@ -339,23 +339,11 @@ export default {
|
|||
price: '',
|
||||
discountRate: 0,
|
||||
discountMoney: 0,
|
||||
remark: 0,
|
||||
arrivalQuantity: 0
|
||||
remark: '',
|
||||
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)
|
||||
this.$emit('apply', applyDetail)
|
||||
this.$emit('apply2', applyDetail)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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-row>
|
||||
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
|
||||
|
@ -196,6 +196,10 @@ export default {
|
|||
contractcontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -247,6 +251,7 @@ export default {
|
|||
pageSize: 10,
|
||||
repositoryId: 438,
|
||||
regionIds: 2,
|
||||
supplierId: this.supp,
|
||||
createPersonId: 3
|
||||
},
|
||||
// 传给组件的数据
|
||||
|
@ -260,11 +265,12 @@ export default {
|
|||
watch: {
|
||||
contractcontrol() {
|
||||
this.employeeVisible = this.contractcontrol
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierId = this.supp
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
// 更新采购类型
|
||||
updatecountry() {
|
||||
|
@ -367,7 +373,7 @@ export default {
|
|||
discountMoney: item.discountMoney,
|
||||
price: item.price,
|
||||
includeTaxPrice: item.includeTaxPrice,
|
||||
arrivalQuantity: 0,
|
||||
arrivalQuantity: '0.00',
|
||||
taxRate: item.taxRate,
|
||||
money: item.money,
|
||||
includeTaxMoney: item.includeTaxMoney,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<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: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -173,6 +177,7 @@ export default {
|
|||
typeid: '',
|
||||
isactive: '',
|
||||
Productid: '',
|
||||
supplierid: this.supp,
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
}
|
||||
|
@ -183,6 +188,11 @@ export default {
|
|||
this.productVisible = this.control
|
||||
console.log(this.control)
|
||||
this.getlist()
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierid = this.supp
|
||||
this.getlist()
|
||||
console.log(this.supp)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
|
@ -47,7 +47,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -58,7 +58,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
|
@ -67,6 +67,7 @@
|
|||
<el-form-item :label="$t('StockOrder.orderDate')" prop="signDate" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="personalForm.orderDate"
|
||||
:picker-options="pickerOptions1"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width: 200px"/>
|
||||
|
@ -74,13 +75,13 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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>
|
||||
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
|
@ -92,7 +93,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
|
@ -112,12 +113,17 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="2" label="USD"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form>
|
||||
</div>
|
||||
|
@ -127,12 +133,12 @@
|
|||
<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;">
|
||||
<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>
|
||||
<my-apply :applycontrol.sync="applycontrol" @apply="apply" @allapplyinfo="allapplyinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" @plan="plan" @allPlaninfo="allPlaninfo"/>
|
||||
<my-lnquiry :inquirycontrol.sync="inquirycontrol" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
|
||||
<my-contract :contractcontrol.sync="contractcontrol" @contract="contract" @allcontractinfo="allcontractinfo"/>
|
||||
<my-plan :plancontrol.sync="plancontrol" :supp.sync="supp" @plan="plan" @allPlaninfo="allPlaninfo"/>
|
||||
<my-lnquiry :inquirycontrol.sync="inquirycontrol" :supp.sync="supp" @lnquiry="lnquiry" @allLnquirinfo="allLnquirinfo"/>
|
||||
<my-contract :contractcontrol.sync="contractcontrol" :supp.sync="supp" @contract="contract" @allcontractinfo="allcontractinfo"/>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -154,10 +160,11 @@
|
|||
<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="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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.price"
|
||||
@input="getprice(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.includeTaxPrice"
|
||||
@input="getincludeTaxPrice(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.taxRate"
|
||||
@input="gettaxRate(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.discountRate"
|
||||
@input="getdiscountRate(scope.row)"/>
|
||||
</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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.discountMoney"
|
||||
@input="getdiscountMoney(scope.row)"/>
|
||||
</template>
|
||||
</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="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>
|
||||
</div>
|
||||
|
@ -220,36 +231,36 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
|
@ -294,14 +305,63 @@ export default {
|
|||
},
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.supplierId)
|
||||
if (this.supplierId === undefined || this.supplierId === null || this.supplierId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
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: [],
|
||||
// 弹窗组件的控制
|
||||
|
@ -359,17 +419,20 @@ export default {
|
|||
control: false,
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
signPersonId: [
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
],
|
||||
stockPersonId: [
|
||||
{ required: true, validator: validatePass3, trigger: 'change' }
|
||||
],
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
inquiryPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
],
|
||||
inquiryDate: [
|
||||
orderDate: [
|
||||
{ required: true, message: '请选择询价日期', trigger: 'change' }
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: '请选择部门', trigger: 'change' }
|
||||
{ required: true, validator: validatePass4, trigger: 'change' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
|
@ -382,6 +445,9 @@ export default {
|
|||
list2: [],
|
||||
// 采购申请单明细列表规则
|
||||
validRules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -403,6 +469,10 @@ export default {
|
|||
this.getways()
|
||||
},
|
||||
methods: {
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 总计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
|
@ -417,9 +487,9 @@ export default {
|
|||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
return (Number(prev) + Number(curr)).toFixed(2)
|
||||
} else {
|
||||
return (prev).toFixed(2)
|
||||
return (Number(prev)).toFixed(2)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ''
|
||||
|
@ -431,21 +501,21 @@ export default {
|
|||
sums[3] = ''
|
||||
sums[4] = ''
|
||||
sums[5] = ''
|
||||
sums[6] = ''
|
||||
sums[7] = ''
|
||||
sums[8] = ''
|
||||
sums[9] = ''
|
||||
sums[10] = ''
|
||||
sums[13] = ''
|
||||
sums[14] = ''
|
||||
sums[15] = ''
|
||||
sums[16] = ''
|
||||
sums[17] = ''
|
||||
sums[18] = ''
|
||||
sums[19] = ''
|
||||
this.allNumber = sums[7]
|
||||
this.allMoney = sums[11]
|
||||
this.allTaxMoney = sums[13]
|
||||
this.allIncludeTaxMoney = sums[12]
|
||||
this.allDiscountMoney = sums[16]
|
||||
this.allMoneyMoveDiscount = sums[12] - sums[16]
|
||||
this.allNumber = sums[6]
|
||||
this.allMoney = sums[10]
|
||||
this.allTaxMoney = sums[12]
|
||||
this.allIncludeTaxMoney = sums[11]
|
||||
this.allDiscountMoney = sums[15]
|
||||
this.allMoneyMoveDiscount = sums[11] - sums[15]
|
||||
return sums
|
||||
},
|
||||
getways() {
|
||||
|
@ -485,57 +555,152 @@ export default {
|
|||
},
|
||||
// 通过税率计算含税价
|
||||
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) {
|
||||
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)).toFixed(2)
|
||||
row.includeTaxPrice = (row.price * (1 + row.taxRate / 100)).toFixed(2)
|
||||
},
|
||||
// 计算税额
|
||||
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
|
||||
},
|
||||
// 计算含税金额
|
||||
getTaxMoney(row) {
|
||||
row.includeTaxMoney = row.stockQuantity * row.includeTaxPrice
|
||||
row.includeTaxMoney = (row.stockQuantity * row.includeTaxPrice).toFixed(2)
|
||||
return row.includeTaxMoney
|
||||
},
|
||||
// 计算金额
|
||||
getMoney(row) {
|
||||
row.money = row.stockQuantity * row.price
|
||||
row.money = (row.stockQuantity * row.price).toFixed(2)
|
||||
return row.money
|
||||
},
|
||||
// 选择源单类型事件
|
||||
chooseType() {
|
||||
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.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.addpro = false
|
||||
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') {
|
||||
this.addpro = false
|
||||
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() {
|
||||
console.log(this.personalForm.supplierId)
|
||||
if (this.personalForm.sourceType === '1') {
|
||||
this.applycontrol = true
|
||||
} 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
|
||||
} 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
|
||||
} 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
|
||||
}
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
},
|
||||
// 采购合同加载过来数据
|
||||
contract(val) {
|
||||
|
@ -589,16 +754,15 @@ export default {
|
|||
}
|
||||
},
|
||||
allLnquirinfo(val) {
|
||||
this.personalForm.supplierId = val.supplierId
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.stockType = val.stockTypeId
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockTypeId
|
||||
this.personalForm.deptId = val.deptId
|
||||
this.personalForm.isVat = val.isVat
|
||||
searchsupplier(val.supplierName).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
console.log(res)
|
||||
this.personalForm.deliveryMode = res.data.data.content.list[0].giveId
|
||||
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()
|
||||
})
|
||||
|
@ -623,13 +787,15 @@ export default {
|
|||
}
|
||||
},
|
||||
allapplyinfo(val) {
|
||||
this.personalForm.stockType = val.stockType
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockType
|
||||
this.personalForm.deptId = val.applyDeptId
|
||||
},
|
||||
// 采购计划加载过来数据
|
||||
plan(val) {
|
||||
console.log(val)
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
const quchonggong = this.personalForm.supplierId
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
if (val[i].productCode === nowlistdata[j].productCode) {
|
||||
|
@ -641,13 +807,21 @@ export default {
|
|||
return false
|
||||
}
|
||||
}
|
||||
if (val[i].supplierId !== quchonggong) {
|
||||
console.log(1234)
|
||||
continue
|
||||
}
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
allPlaninfo(val) {
|
||||
console.log(val)
|
||||
this.personalForm.stockTypeId = val.stockType
|
||||
this.personalForm.stockType = val.stockType
|
||||
this.personalForm.deptId = val.stockDeptId
|
||||
this.personalForm.isVat = val.isVat
|
||||
this.stockPersonId = val.stockPersonName
|
||||
this.personalForm.stockPersonId = val.stockPersonId
|
||||
},
|
||||
// 更新类型
|
||||
updatecountry() {
|
||||
|
@ -676,6 +850,8 @@ export default {
|
|||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.personalForm.supplierId = val.id
|
||||
this.supp = val.id
|
||||
this.$refs.editable.clear()
|
||||
},
|
||||
// 采购员focus事件
|
||||
handlechooseStock() {
|
||||
|
@ -696,6 +872,14 @@ export default {
|
|||
},
|
||||
// 采购申请明细来源
|
||||
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
|
||||
},
|
||||
productdetail(val) {
|
||||
|
@ -778,6 +962,9 @@ export default {
|
|||
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.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
|
@ -809,26 +996,41 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatestockorder(parms, parms2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
updatestockorder(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
|
||||
})
|
||||
}
|
||||
})
|
||||
}).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 {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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-row>
|
||||
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
|
||||
|
@ -199,6 +199,10 @@ export default {
|
|||
inquirycontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -250,6 +254,7 @@ export default {
|
|||
pageSize: 10,
|
||||
repositoryId: 438,
|
||||
regionIds: 2,
|
||||
supplierId: this.supp,
|
||||
createPersonId: 3,
|
||||
judgeStat: ''
|
||||
},
|
||||
|
@ -265,6 +270,11 @@ export default {
|
|||
inquirycontrol() {
|
||||
this.employeeVisible = this.inquirycontrol
|
||||
this.getlist()
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierId = this.supp
|
||||
this.getlist()
|
||||
console.log(this.supp)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -372,7 +382,7 @@ export default {
|
|||
remark: 0,
|
||||
discountRate: 0,
|
||||
discountMoney: 0,
|
||||
arrivalQuantity: 0,
|
||||
arrivalQuantity: '0.00',
|
||||
price: item.price,
|
||||
includeTaxPrice: item.includeTaxPrice,
|
||||
taxRate: item.taxRate,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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-row>
|
||||
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
|
||||
|
@ -181,6 +181,10 @@ export default {
|
|||
plancontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
supp: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -227,6 +231,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
repositoryId: 438,
|
||||
supplierId: this.supp,
|
||||
regionIds: 2,
|
||||
createPersonId: 3
|
||||
},
|
||||
|
@ -241,6 +246,11 @@ export default {
|
|||
watch: {
|
||||
plancontrol() {
|
||||
this.employeeVisible = this.plancontrol
|
||||
},
|
||||
supp() {
|
||||
this.getemplist.supplierId = this.supp
|
||||
this.getlist()
|
||||
console.log(this.supp)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -334,9 +344,10 @@ export default {
|
|||
remark: 0,
|
||||
discountRate: 0,
|
||||
discountMoney: 0,
|
||||
arrivalQuantity: 0,
|
||||
arrivalQuantity: '0.00',
|
||||
price: item.basicPrice,
|
||||
includeTaxPrice: item.basicPrice
|
||||
includeTaxPrice: item.basicPrice,
|
||||
supplierId: item.supplierId
|
||||
}
|
||||
})
|
||||
console.log(applyDetail)
|
||||
|
|
|
@ -25,19 +25,19 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -59,6 +59,7 @@
|
|||
<el-form-item :label="$t('StockPlan.planDate')" prop="planDate" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="personalForm.planDate"
|
||||
:picker-options="pickerOptions1"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px"/>
|
||||
|
@ -75,7 +76,7 @@
|
|||
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
|
||||
<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"/>
|
||||
<el-button type="danger" @click="deleteEdit">删除</el-button>
|
||||
</div>
|
||||
|
@ -103,7 +104,9 @@
|
|||
<p>{{ basicPrice(scope.row) }}</p>
|
||||
</template>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ planMoney(scope.row) }}</p>
|
||||
|
@ -114,10 +117,11 @@
|
|||
<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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-model="scope.row.supplierName" :value="scope.row.supplierName" @focus="handlechoose"/>
|
||||
<my-supplier :control.sync="empcontrol" @supplierName="personName(scope, $event)"/>
|
||||
<el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
|
||||
<my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -147,16 +151,17 @@
|
|||
<p>{{ basicPrice(scope.row) }}</p>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px"/>
|
||||
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
|
||||
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ planMoney(scope.row) }}</p>
|
||||
<p>{{ planQuantity(scope.row) }}</p>
|
||||
</template>
|
||||
</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 prop="applyReason" 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="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -167,12 +172,12 @@
|
|||
<el-row>
|
||||
<el-col :span="6">
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<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-col>
|
||||
</el-row>
|
||||
|
@ -191,27 +196,52 @@
|
|||
<script>
|
||||
import { addstockplan } from '@/api/StockPlan'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { productlist } from '@/api/public'
|
||||
// import { productlist } from '@/api/public'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import MyEmp from './components/MyEmp'
|
||||
import MyDelivery from '../DailyAdjust/components/MyDelivery'
|
||||
import MyDetail from './components/MyDetail'
|
||||
import MyApply from './components/MyApply'
|
||||
import MySupplier from '../Product/components/MySupplier'
|
||||
import MySupplier from './components/MySupplier'
|
||||
import MyRequire from './components/MyRequire'
|
||||
export default {
|
||||
name: 'AddStockPlan',
|
||||
components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.planPersonId)
|
||||
if (this.planPersonId === undefined || this.planPersonId === null || this.planPersonId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
}
|
||||
},
|
||||
// 传商品code去获取能提供这个商品的供应商
|
||||
procode: null,
|
||||
// 控制scope
|
||||
kongscope: '',
|
||||
// 合计数据
|
||||
heji1: '',
|
||||
heji2: '',
|
||||
|
@ -251,7 +281,8 @@ export default {
|
|||
createPersonId: 3,
|
||||
countryId: 1,
|
||||
repositoryId: 438,
|
||||
regionId: 2
|
||||
regionId: 2,
|
||||
sourceType: '3'
|
||||
},
|
||||
// 采购计划单规则数据
|
||||
personalrules: {
|
||||
|
@ -262,16 +293,16 @@ export default {
|
|||
{ required: true, message: '请选择计划日期', trigger: 'change' }
|
||||
],
|
||||
stockDeptId: [
|
||||
{ required: true, message: '请选择采购部门', trigger: 'change' }
|
||||
{ required: true, validator: validatePass3, trigger: 'change' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
],
|
||||
planPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
stockPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 采购计划单明细数据
|
||||
|
@ -280,18 +311,40 @@ export default {
|
|||
list3: [],
|
||||
// 采购计划单明细列表规则
|
||||
validRules: {
|
||||
supplierName: [
|
||||
{ required: true, message: '请选择供应商', trigger: 'none' }
|
||||
],
|
||||
planQuantity: [
|
||||
{ required: true, message: '请输入计划数量', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
this.getdatatime()
|
||||
this.chooseType()
|
||||
},
|
||||
methods: {
|
||||
planQuantity(row) {
|
||||
return (row.planQuantity).toFixed(2)
|
||||
},
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getdatatime() { // 默认显示今天
|
||||
this.personalForm.planDate = new Date()
|
||||
},
|
||||
// 计划金额
|
||||
planMoney(row) {
|
||||
row.planMoney = row.basicPrice * row.planQuantity
|
||||
row.planMoney = (row.basicPrice * row.planQuantity).toFixed(2)
|
||||
return row.planMoney
|
||||
},
|
||||
// 转化单价
|
||||
basicPrice(row) {
|
||||
return (row.basicPrice).toFixed(2)
|
||||
},
|
||||
// 总计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
|
@ -306,9 +359,9 @@ export default {
|
|||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
return (Number(prev) + Number(curr)).toFixed(2)
|
||||
} else {
|
||||
return prev
|
||||
return (Number(prev)).toFixed(2)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ''
|
||||
|
@ -329,15 +382,6 @@ export default {
|
|||
sums[12] = ''
|
||||
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) {
|
||||
this.$refs.editable2.clear()
|
||||
|
@ -347,19 +391,26 @@ export default {
|
|||
}
|
||||
},
|
||||
// 供货商输入框focus事件触发
|
||||
handlechoose() {
|
||||
handlechoose(scope) {
|
||||
this.empcontrol = true
|
||||
this.kongscope = scope
|
||||
this.procode = scope.row.productCode
|
||||
},
|
||||
// 供货商列表返回数据
|
||||
personName(scope, val) {
|
||||
scope.row.supplierName = val.supplierName
|
||||
scope.row.supplierId = val.id
|
||||
console.log(scope)
|
||||
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()
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
console.log(nowlistdata)
|
||||
for (let i = 0; i < nowlistdata.length; i++) {
|
||||
this.$refs.editable2.insert(nowlistdata[i])
|
||||
}
|
||||
return
|
||||
},
|
||||
|
||||
// 选择源单类型事件
|
||||
|
@ -367,14 +418,22 @@ export default {
|
|||
console.log(this.personalForm.sourceType)
|
||||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
|
||||
this.addsouce = false
|
||||
this.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.addpro = false
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
if (this.$refs.editable2.getRecords().length !== 0) {
|
||||
this.$refs.editable2.clear()
|
||||
}
|
||||
} else if (this.personalForm.sourceType === '3') {
|
||||
this.addpro = false
|
||||
this.addsouce = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
if (this.$refs.editable2.getRecords().length !== 0) {
|
||||
this.$refs.editable2.clear()
|
||||
}
|
||||
}
|
||||
},
|
||||
// 无来源添加商品
|
||||
|
@ -423,8 +482,11 @@ export default {
|
|||
this.requirecontrol = true
|
||||
}
|
||||
},
|
||||
apply(val) {
|
||||
allinfo(val) {
|
||||
console.log(val)
|
||||
this.personalForm.planDate = val.applyDate
|
||||
},
|
||||
apply(val) {
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
|
@ -542,6 +604,7 @@ export default {
|
|||
deliveryName(val) {
|
||||
this.stockPersonId = val.personName
|
||||
this.personalForm.stockPersonId = val.id
|
||||
this.personalForm.stockDeptId = val.deptId
|
||||
},
|
||||
// 清空记录
|
||||
restAllForm() {
|
||||
|
@ -620,27 +683,31 @@ export default {
|
|||
const parms = JSON.stringify(Data)
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
addstockplan(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.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
addstockplan(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.editable2.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(valid => {
|
||||
console.log('error submit!!')
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
|
|
|
@ -332,11 +332,14 @@ export default {
|
|||
color: item.color,
|
||||
basicQuantity: item.applyQuantity,
|
||||
planDeliveryDate: item.requireDate,
|
||||
planQuantity: item.applyQuantity,
|
||||
applyReason: item.applyReason,
|
||||
sourceNumber: number,
|
||||
supplierId: '',
|
||||
supplierName: '',
|
||||
basicPrice: ''
|
||||
basicPrice: 0,
|
||||
planMoney: '0.00',
|
||||
orderQuantity: '0.00'
|
||||
}
|
||||
})
|
||||
this.$emit('apply', applyDetail)
|
||||
|
|
|
@ -267,13 +267,16 @@ export default {
|
|||
color: item.color,
|
||||
unit: item.purMeasu,
|
||||
productType: item.productType,
|
||||
basicQuantity: 0,
|
||||
basicQuantity: '1.00',
|
||||
planDeliveryDate: '',
|
||||
applyReason: '',
|
||||
sourceNumber: '',
|
||||
supplierId: item.supplierId,
|
||||
supplierName: item.supplierName,
|
||||
basicPrice: ''
|
||||
basicPrice: 0,
|
||||
planMoney: '0.00',
|
||||
planQuantity: 1,
|
||||
orderQuantity: '0.00'
|
||||
}
|
||||
})
|
||||
console.log(productDetail)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
|
@ -74,7 +74,7 @@
|
|||
<el-button :disabled="addpro" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
|
||||
<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"/>
|
||||
<el-button type="danger" @click="deleteEdit">删除</el-button>
|
||||
</div>
|
||||
|
@ -102,7 +102,9 @@
|
|||
<p>{{ basicPrice(scope.row) }}</p>
|
||||
</template>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ planMoney(scope.row) }}</p>
|
||||
|
@ -113,10 +115,11 @@
|
|||
<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">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-model="scope.row.supplierName" :value="scope.row.supplierName" @focus="handlechoose"/>
|
||||
<my-supplier :control.sync="empcontrol" @supplierName="personName(scope, $event)"/>
|
||||
<el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
|
||||
<my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column prop="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -146,20 +149,21 @@
|
|||
<p>{{ basicPrice(scope.row) }}</p>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px"/>
|
||||
<el-editable-column prop="planMoney" align="center" label="计划金额" min-width="150px">
|
||||
<el-editable-column prop="planQuantity" align="center" label="计划数量" min-width="150px">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ planMoney(scope.row) }}</p>
|
||||
<p>{{ planQuantity(scope.row) }}</p>
|
||||
</template>
|
||||
</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 prop="applyReason" 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="orderQuantity" align="center" label="已订购数量" min-width="150px"/>
|
||||
</el-editable>
|
||||
</div>
|
||||
</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>
|
||||
<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">
|
||||
|
@ -190,13 +194,13 @@
|
|||
<script>
|
||||
import { updatestockplan } from '@/api/StockPlan'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { productlist } from '@/api/public'
|
||||
// import { productlist } from '@/api/public'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import MyEmp from './MyEmp'
|
||||
import MyDelivery from '../../DailyAdjust/components/MyDelivery'
|
||||
import MyDetail from './MyDetail'
|
||||
import MyApply from './MyApply'
|
||||
import MySupplier from '../../Product/components/MySupplier'
|
||||
import MySupplier from './MySupplier'
|
||||
import MyRequire from './MyRequire'
|
||||
export default {
|
||||
components: { MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
|
@ -212,14 +216,39 @@ export default {
|
|||
},
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === '') {
|
||||
callback(new Error('请选择'))
|
||||
console.log(this.planPersonId)
|
||||
if (this.planPersonId === undefined || this.planPersonId === null || this.planPersonId === '') {
|
||||
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 {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
}
|
||||
},
|
||||
// 传商品code去获取能提供这个商品的供应商
|
||||
procode: null,
|
||||
// 控制scope
|
||||
kongscope: '',
|
||||
// 选择的数据
|
||||
choosedata: [],
|
||||
// 弹窗组件的控制
|
||||
|
@ -267,16 +296,16 @@ export default {
|
|||
{ required: true, message: '请选择计划日期', trigger: 'change' }
|
||||
],
|
||||
stockDeptId: [
|
||||
{ required: true, message: '请选择采购部门', trigger: 'change' }
|
||||
{ required: true, validator: validatePass3, trigger: 'change' }
|
||||
],
|
||||
sourceType: [
|
||||
{ required: true, message: '请选择源单类型', trigger: 'change' }
|
||||
],
|
||||
planPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
stockPersonId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
{ required: true, validator: validatePass2, trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 采购计划单明细数据
|
||||
|
@ -285,6 +314,12 @@ export default {
|
|||
list3: [],
|
||||
// 采购计划单明细列表规则
|
||||
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.list2 = this.personalForm.stockPlanDetailVos
|
||||
this.list3 = this.personalForm.stockPlanDetailVos
|
||||
this.getdatatime()
|
||||
this.chooseType()
|
||||
}
|
||||
},
|
||||
|
@ -305,11 +341,25 @@ export default {
|
|||
this.getTypes()
|
||||
},
|
||||
methods: {
|
||||
planQuantity(row) {
|
||||
return (row.planQuantity).toFixed(2)
|
||||
},
|
||||
// 重置一下下拉
|
||||
change() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getdatatime() { // 默认显示今天
|
||||
this.personalForm.planDate = new Date()
|
||||
},
|
||||
// 计划金额
|
||||
planMoney(row) {
|
||||
row.planMoney = row.basicPrice * row.planQuantity
|
||||
row.planMoney = (row.basicPrice * row.planQuantity).toFixed(2)
|
||||
return row.planMoney
|
||||
},
|
||||
// 转化单价
|
||||
basicPrice(row) {
|
||||
return (row.basicPrice).toFixed(2)
|
||||
},
|
||||
// 总计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
|
@ -324,9 +374,9 @@ export default {
|
|||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
return (Number(prev) + Number(curr)).toFixed(2)
|
||||
} else {
|
||||
return prev
|
||||
return (Number(prev)).toFixed(2)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ''
|
||||
|
@ -347,15 +397,6 @@ export default {
|
|||
sums[12] = ''
|
||||
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) {
|
||||
this.$refs.editable2.clear()
|
||||
|
@ -365,13 +406,15 @@ export default {
|
|||
}
|
||||
},
|
||||
// 供货商输入框focus事件触发
|
||||
handlechoose() {
|
||||
handlechoose(scope) {
|
||||
this.empcontrol = true
|
||||
this.kongscope = scope
|
||||
this.procode = scope.row.productCode
|
||||
},
|
||||
// 供货商列表返回数据
|
||||
personName(scope, 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()
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
console.log(nowlistdata)
|
||||
|
@ -385,14 +428,22 @@ export default {
|
|||
console.log(this.personalForm.sourceType)
|
||||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '2') {
|
||||
this.addsouce = false
|
||||
this.addpro = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
this.addpro = false
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
if (this.$refs.editable2.getRecords().length !== 0) {
|
||||
this.$refs.editable2.clear()
|
||||
}
|
||||
} else if (this.personalForm.sourceType === '3') {
|
||||
this.addpro = false
|
||||
this.addsouce = true
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.editable2.clear()
|
||||
if (this.$refs.editable.getRecords().length !== 0) {
|
||||
this.$refs.editable.clear()
|
||||
}
|
||||
if (this.$refs.editable2.getRecords().length !== 0) {
|
||||
this.$refs.editable2.clear()
|
||||
}
|
||||
}
|
||||
},
|
||||
// 无来源添加商品
|
||||
|
@ -441,8 +492,11 @@ export default {
|
|||
this.requirecontrol = true
|
||||
}
|
||||
},
|
||||
apply(val) {
|
||||
allinfo(val) {
|
||||
console.log(val)
|
||||
this.personalForm.planDate = val.applyDate
|
||||
},
|
||||
apply(val) {
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
|
@ -560,6 +614,7 @@ export default {
|
|||
deliveryName(val) {
|
||||
this.stockPersonId = val.personName
|
||||
this.personalForm.stockPersonId = val.id
|
||||
this.personalForm.stockDeptId = val.deptId
|
||||
},
|
||||
// 清空记录
|
||||
restAllForm() {
|
||||
|
@ -642,27 +697,42 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatestockplan(parms, parms2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.editable.validate().then(valid => {
|
||||
updatestockplan(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.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 {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -295,12 +295,15 @@ export default {
|
|||
unit: item.unit,
|
||||
color: item.color,
|
||||
basicQuantity: item.requireQuantity,
|
||||
planQuantity: item.requireQuantity,
|
||||
planDeliveryDate: item.requireDate,
|
||||
applyReason: '',
|
||||
sourceNumber: item.materialsRequireNumber,
|
||||
supplierId: '',
|
||||
supplierName: '',
|
||||
basicPrice: ''
|
||||
basicPrice: 0,
|
||||
planMoney: '0.00',
|
||||
orderQuantity: '0.00'
|
||||
}
|
||||
})
|
||||
this.$emit('require', requireDetail)
|
||||
|
|
303
src/views/StockPlan/components/MySupplier.vue
Normal file
303
src/views/StockPlan/components/MySupplier.vue
Normal 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>
|
|
@ -17,6 +17,7 @@
|
|||
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px" @change="chooseType">
|
||||
<el-option value="1" label="采购到货单" />
|
||||
<el-option value="2" label="无来源" />
|
||||
<el-option value="3" label="采购入库单" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -115,6 +116,12 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form>
|
||||
</div>
|
||||
|
@ -154,11 +161,27 @@
|
|||
<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="taxRate" align="center" label="税率(%)" min-width="170px"/>
|
||||
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
|
||||
<el-editable-column prop="includeTaxMoney" 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">
|
||||
<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="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="sourceNumber" 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 MyOrder from './components/MyOrder'
|
||||
import MyArrival from './components/MyArrival'
|
||||
import MyRepository from './components/MyRepository'
|
||||
export default {
|
||||
name: 'AddStockRetreat',
|
||||
components: { MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
components: { MyRepository, MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
|
@ -235,6 +259,10 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
// 回显仓库
|
||||
retreatRepositoryId: '',
|
||||
// 控制仓库
|
||||
repositorycontrol: false,
|
||||
// 合计数据
|
||||
allNumber: '',
|
||||
allMoney: '',
|
||||
|
@ -307,6 +335,9 @@ export default {
|
|||
],
|
||||
stockTypeId: [
|
||||
{ required: true, message: '请选择采购类别', trigger: 'change' }
|
||||
],
|
||||
retreatRepositoryId: [
|
||||
{ required: true, validator: validatePass, trigger: 'focus' }
|
||||
]
|
||||
},
|
||||
// 采购申请单明细数据
|
||||
|
@ -321,6 +352,15 @@ export default {
|
|||
this.getways()
|
||||
},
|
||||
methods: {
|
||||
// 仓库列表focus事件触发
|
||||
handlechooseRep() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
repositoryname(val) {
|
||||
console.log(val)
|
||||
this.retreatRepositoryId = val.repositoryName
|
||||
this.personalForm.retreatRepositoryId = val.id
|
||||
},
|
||||
// 总计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
|
@ -362,6 +402,25 @@ export default {
|
|||
this.allMoneyMoveDiscount = sums[13] - sums[16]
|
||||
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() {
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
|
@ -558,41 +617,29 @@ export default {
|
|||
delete elem.taxRate
|
||||
}
|
||||
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) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
delete elem.discountRate
|
||||
}
|
||||
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
|
||||
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) {
|
||||
delete elem.remark
|
||||
}
|
||||
|
|
|
@ -363,12 +363,12 @@ export default {
|
|||
remark: item.remark,
|
||||
price: item.price,
|
||||
includeTaxPrice: item.includeTaxPrice,
|
||||
taxRate: item.taxRate,
|
||||
taxRate: item.taxRate * 100,
|
||||
money: item.money,
|
||||
includeTaxMoney: item.includeTaxMoney,
|
||||
taxMoney: item.taxMoney,
|
||||
discountMoney: item.discountMoney,
|
||||
discountRate: item.discountRate
|
||||
discountRate: item.discountRate * 100
|
||||
}
|
||||
})
|
||||
console.log(arrivalDetail)
|
||||
|
|
|
@ -155,11 +155,27 @@
|
|||
<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="taxRate" align="center" label="税率(%)" min-width="170px"/>
|
||||
<el-editable-column prop="money" align="center" label="金额" min-width="150px"/>
|
||||
<el-editable-column prop="includeTaxMoney" 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">
|
||||
<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="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="sourceNumber" 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]
|
||||
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() {
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
|
|
263
src/views/StockRetreat/components/MyRepository.vue
Normal file
263
src/views/StockRetreat/components/MyRepository.vue
Normal 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>
|
|
@ -606,7 +606,7 @@ export default {
|
|||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
groupId: [],
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
|
|
|
@ -348,6 +348,7 @@ export default {
|
|||
},
|
||||
// 修改组件修改成功后返回
|
||||
refreshlist(val) {
|
||||
console.log(val)
|
||||
if (val === true) {
|
||||
this.getlist()
|
||||
}
|
||||
|
|
|
@ -635,6 +635,7 @@ export default {
|
|||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.$emit('rest', true)
|
||||
this.restAllForm()
|
||||
this.$refs.editable.clear()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
|
|
Loading…
Reference in a new issue