@ -112,7 +112,7 @@
< / div >
< / div >
< JNPF -table v -loading = " listLoading " :data ="list" @ sort -change = ' sortChange ' has -c :hasNO ="false"
@ selection - change = "handleSelectionChange" border >
@ selection - change = "handleSelectionChange" border show - summary : summary - method = "getSummaries" >
< el -table -column type = "index" width = "50" label = "序号" fixed = "left" align = "center" / >
< el -table -column prop = "vehicleName" label = "车号" fixed = "left" sortable width = "120" align = "center" / >
< el -table -column prop = "purchaseStatus" label = "采购状态" sortable width = "100" align = "center" >
@ -126,20 +126,19 @@
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "materialName" label = "物料名称" sortable width = "150" align = "center" / >
< el -table -column prop = "settlement" sortable label = "结算重量" width = "100" align = "center" / >
< el -table -column prop = "purchasePrice" sortable label = "采购单价" width = "100" align = "center" / >
< el -table -column prop = "salesPrice" sortable label = "销售价格" width = "100" align = "center" / >
< el -table -column prop = "collectPrice" sortable label = "收货价格" width = "100" align = "center" / >
< el -table -column prop = "grossWeight" sortable label = "毛重" width = "100" align = "center" / >
< el -table -column prop = "tareWeight" sortable label = "皮重" width = "100" align = "center" / >
< el -table -column prop = "netWeight" sortable label = "净重" width = "100" align = "center" / >
< el -table -column prop = "buckleWeight" sortable label = "扣重" width = "100" align = "center" / >
< el -table -column prop = "unit" label = "单位" sortable width = "100" align = "center" >
< template slot -scope = " scope " >
{ { scope . row . unit | dynamicText ( unitOptions ) } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "grossWeight" sortable label = "毛重" width = "100" align = "center" / >
< el -table -column prop = "tareWeight" sortable label = "皮重" width = "100" align = "center" / >
< el -table -column prop = "netWeight" sortable label = "净重" width = "100" align = "center" / >
< el -table -column prop = "buckleWeight" sortable label = "扣重" width = "100" align = "center" / >
< el -table -column prop = "settlement" sortable label = "结算重量" width = "100" align = "center" / >
< el -table -column prop = "purchasePrice" sortable label = "采购单价" width = "100" align = "center" / >
< el -table -column prop = "salesPrice" sortable label = "销售价格" width = "100" align = "center" / >
< el -table -column prop = "collectPrice" sortable label = "收货价格" width = "100" align = "center" / >
< el -table -column prop = "poundlistNo" label = "磅单号" width = "200" align = "center" sortable / >
< el -table -column prop = "customerName" label = "客户名称" sortable width = "150" align = "center" / >
< el -table -column prop = "salesName" label = "销售合同" sortable width = "150" align = "center" / >
@ -151,16 +150,12 @@
{ { scope . row . advance | dynamicText ( advanceOptions ) } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "creatorTime" label = "创建时间" width = "200" align = "center" sortable
/ >
< el -table -column prop = "inputDate" sortable label = "进项票日期" width = "150" align = "center" / >
< el -table -column prop = "outputDate" sortable label = "销项票日期" width = "150" align = "center" / >
< el -table -column prop = "payDate" sortable label = "付款日期" width = "150" align = "center" / >
< el -table -column prop = "paymentDate" sortable label = "回款日期" width = "150" align = "center" / >
< el -table -column prop = "poundDate" sortable label = "磅单日期" width = "150" align = "center" / >
< el -table -column prop = "inputDateStr" sortable label = "进项票日期" width = "150" align = "center" / >
< el -table -column prop = "outputDateStr" sortable label = "销项票日期" width = "150" align = "center" / >
< el -table -column prop = "payDateStr" sortable label = "付款日期" width = "150" align = "center" / >
< el -table -column prop = "paymentDateStr" sortable label = "回款日期" width = "150" align = "center" / >
< el -table -column prop = "poundDateStr" sortable label = "磅单日期" width = "150" align = "center" / >
< el -table -column prop = "creatorTimeStr" sortable label = "创建日期" width = "150" align = "center" / >
< el -table -column prop = "businessName" sortable label = "业务员" width = "150" align = "center" / >
< el -table -column label = "是否开进项票" width = "120" sortable prop = "isInvoicing" align = "center" >
< template slot -scope = " scope " >
@ -213,7 +208,7 @@
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "操作" fixed = "right" width = "1 0 0" align = "center" >
< el -table -column label = "操作" fixed = "right" width = "1 5 0" align = "center" >
< template slot -scope = " scope " >
< el -button type = "text" @click ="addOrUpdateHandle(scope.row.id)" > 编 辑
< / e l - b u t t o n >
@ -230,8 +225,7 @@
< / div >
< JNPF -Form v -if = " formVisible " ref = "JNPFForm" @refresh ="refresh" / >
< JNPF -Form2 v -if = " formVisible2 " ref = "JNPFForm2" @refresh ="refresh2" / >
< JNPF -Form3 v -if = " formVisible3 " ref = "JNPFForm3" @refresh ="refresh3" / >
< JNPF -Form4 v -if = " formVisible " ref = "JNPFForm4" @refresh ="refresh" / >
< JNPF -Form4 v -if = " formVisible4 " ref = "JNPFForm4" @refresh ="refresh4" / >
< ExportBox v -if = " exportBoxVisible " ref = "ExportBox" @download ="download" / >
< Detail v -if = " detailVisible " ref = "Detail" @refresh ="detailVisible=false" / >
< / div >
@ -244,7 +238,6 @@
} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import JNPFForm2 from './PurchaseOrderForm'
import JNPFForm3 from './PurchaseOrderForm'
import JNPFForm4 from './salesForm'
import ExportBox from './ExportBox'
import {
@ -256,7 +249,6 @@
components : {
JNPFForm ,
JNPFForm2 ,
JNPFForm3 ,
JNPFForm4 ,
ExportBox ,
Detail
@ -287,6 +279,7 @@
formVisible : false ,
formVisible2 : false ,
formVisible3 : false ,
formVisible4 : false ,
exportBoxVisible : false ,
columnList : [ {
prop : 'licenseNo' ,
@ -472,6 +465,31 @@
this . initData ( )
} ,
methods : {
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 ) ) && ( index === 7 || index === 8 || index === 9 || index === 10 || index === 11 ) ) {
sums [ index ] = values . reduce ( ( prev , curr ) => {
const value = Number ( curr ) ;
if ( ! isNaN ( value ) ) {
return prev + curr ;
} else {
return prev ;
}
} , 0 ) ;
} else {
sums [ index ] = '' ;
}
} ) ;
return sums ;
} ,
goDetail ( id ) {
this . detailVisible = true
this . $nextTick ( ( ) => {
@ -501,16 +519,18 @@
} ) . then ( res => {
var _list = [ ] ;
for ( let i = 0 ; i < res . data . list . length ; i ++ ) {
res . data . list [ i ] . inputDate = res . data . list [ i ] . inputDate ? res . data . list [ i ] . inputDate . substring ( 0 ,
res . data . list [ i ] . inputDate Str = res . data . list [ i ] . inputDate ? res . data . list [ i ] . inputDate . substring ( 0 ,
10 ) : '' ;
res . data . list [ i ] . outputDate = res . data . list [ i ] . outputDate ? res . data . list [ i ] . outputDate
res . data . list [ i ] . outputDate Str = res . data . list [ i ] . outputDate ? res . data . list [ i ] . outputDate
. substring ( 0 , 10 ) : '' ;
res . data . list [ i ] . payDate = res . data . list [ i ] . payDate ? res . data . list [ i ] . payDate
res . data . list [ i ] . payDate Str = res . data . list [ i ] . payDate ? res . data . list [ i ] . payDate
. substring ( 0 , 10 ) : '' ;
res . data . list [ i ] . paymentDate = res . data . list [ i ] . paymentDate ? res . data . list [ i ] . paymentDate
res . data . list [ i ] . paymentDate Str = res . data . list [ i ] . paymentDate ? res . data . list [ i ] . paymentDate
. substring ( 0 , 10 ) : '' ;
res . data . list [ i ] . poundDate = res . data . list [ i ] . poundDate ? res . data . list [ i ] . poundDate
res . data . list [ i ] . poundDate Str = res . data . list [ i ] . poundDate ? res . data . list [ i ] . poundDate
. substring ( 0 , 10 ) : '' ;
res . data . list [ i ] . creatorTimeStr = res . data . list [ i ] . creatorTime ? res . data . list [ i ] . creatorTime
. substring ( 0 , 10 ) : '' ;
let _data = res . data . list [ i ] ;
_list . push ( _data )
}
@ -623,7 +643,7 @@
}
if ( list . length > 0 ) {
/ / t h i s . l i s t = _ l i s t
this . formVisible = true
this . formVisible 4 = true
this . $nextTick ( ( ) => {
this . $refs . JNPFForm4 . init ( list )
} )
@ -734,6 +754,10 @@
refresh3 ( isrRefresh ) {
this . formVisible3 = false
if ( isrRefresh ) this . reset ( )
} ,
refresh4 ( isrRefresh ) {
this . formVisible4 = false
if ( isrRefresh ) this . reset ( )
} ,
reset ( ) {
for ( let key in this . query ) {