|
@@ -219,7 +219,7 @@
|
|
:data-source="fabricLoss.fabricCostClothesList"
|
|
:data-source="fabricLoss.fabricCostClothesList"
|
|
bordered
|
|
bordered
|
|
:pagination="false"
|
|
:pagination="false"
|
|
-
|
|
|
|
|
|
+ :footer="clothesFooterShow"
|
|
>
|
|
>
|
|
<!-- 发票数量 -->
|
|
<!-- 发票数量 -->
|
|
<span slot="clInvoiceQuantity" slot-scope="text">
|
|
<span slot="clInvoiceQuantity" slot-scope="text">
|
|
@@ -235,9 +235,10 @@
|
|
:row-key="record => record.id"
|
|
:row-key="record => record.id"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
:columns="costInvoiceIngredientColumns"
|
|
:columns="costInvoiceIngredientColumns"
|
|
- :data-source="fabricLoss.costInvoiceIngredientData"
|
|
|
|
|
|
+ :data-source="fabricLoss.fabricCostAssistList"
|
|
bordered
|
|
bordered
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
|
+ :footer="assistFooterShow"
|
|
>
|
|
>
|
|
<!-- 发票数量 -->
|
|
<!-- 发票数量 -->
|
|
<span slot="ingredientsInvoiceQuantity" slot-scope="text">
|
|
<span slot="ingredientsInvoiceQuantity" slot-scope="text">
|
|
@@ -623,13 +624,32 @@ export default {
|
|
{ invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
|
|
{ invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
|
|
{ invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
|
|
{ invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
|
|
],
|
|
],
|
|
|
|
+ // 开票成本-成衣 表头动态,可能会隐藏人民币列
|
|
|
|
+ costInvoiceClothesColumns:[
|
|
|
|
+ { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
|
|
|
|
+ { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
|
|
|
|
+ { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
|
|
|
|
+ { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
|
|
|
|
+
|
|
|
|
+ { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
|
|
|
|
+ { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
|
|
|
|
+ {
|
|
|
|
+ title: '发票数量',
|
|
|
|
+ dataIndex: 'ipbvquantity',
|
|
|
|
|
|
|
|
+ width: 120,
|
|
|
|
+ className: 'replacecolor',
|
|
|
|
+ customCell: this.clInvoiceQuantityCustomCell,
|
|
|
|
+ scopedSlots: { customRender: 'clInvoiceQuantity' }
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
// 开票成本-成衣 表头
|
|
// 开票成本-成衣 表头
|
|
- costInvoiceClothesColumns: [
|
|
|
|
|
|
+ costInvoiceClothesColumnsAll: [
|
|
{ title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
|
|
{ title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
|
|
{ title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
|
|
{ title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
|
|
- { title: '成衣加工费', width: 120, dataIndex: 'isum', className: 'replacecolor' },
|
|
|
|
- { title: '出运日期', width: 120, dataIndex: 'outData', className: 'replacecolor' },
|
|
|
|
|
|
+ { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
|
|
|
|
+ { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
|
|
|
|
+ { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
|
|
{ title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
|
|
{ title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
|
|
{
|
|
{
|
|
title: '发票数量',
|
|
title: '发票数量',
|
|
@@ -670,23 +690,23 @@ export default {
|
|
|
|
|
|
// 开票成本-辅料 表头
|
|
// 开票成本-辅料 表头
|
|
costInvoiceIngredientColumns: [
|
|
costInvoiceIngredientColumns: [
|
|
- { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
|
|
|
|
- { title: '订单号', width: 120, dataIndex: 'orderNum', className: 'replacecolor' },
|
|
|
|
- { title: '工厂', width: 120, dataIndex: 'factory', className: 'replacecolor' },
|
|
|
|
- { title: ' 类型', width: 120, dataIndex: 'type', className: 'replacecolor' },
|
|
|
|
|
|
+ { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
|
|
|
|
+ { title: '订单号', width: 120, dataIndex: 'cpoid', className: 'replacecolor' },
|
|
|
|
+ { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
|
|
|
|
+ { title: ' 类型', width: 350, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
|
|
{
|
|
{
|
|
title: '发票数量',
|
|
title: '发票数量',
|
|
width: 120,
|
|
width: 120,
|
|
- dataIndex: 'ingredientsInvoiceQuantity',
|
|
|
|
|
|
+ dataIndex: 'iquantityInvoice',
|
|
className: 'replacecolor',
|
|
className: 'replacecolor',
|
|
customCell: this.ingredientsInvoiceQuantityCustomCell,
|
|
customCell: this.ingredientsInvoiceQuantityCustomCell,
|
|
scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
|
|
scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
|
|
},
|
|
},
|
|
- { title: '开票金额(人民币)', width: 120, dataIndex: 'invoiceAmountCNY', className: 'replacecolor' },
|
|
|
|
- { title: '开票金额(美金)', width: 120, dataIndex: 'invoiceAmountUSD', className: 'replacecolor' },
|
|
|
|
- { title: '单位', width: 120, dataIndex: 'unit', className: 'replacecolor' },
|
|
|
|
- { title: '订单数', width: 120, dataIndex: 'orderQuantity', className: 'replacecolor' },
|
|
|
|
- { title: '采购入库数', width: 120, dataIndex: 'purchaseInQuantity', className: 'replacecolor' }
|
|
|
|
|
|
+ { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
|
|
|
|
+ { title: '开票金额(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
|
|
|
|
+ { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
|
|
|
|
+ { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
|
|
|
|
+ { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
|
|
],
|
|
],
|
|
costInvoiceIngredientData: [
|
|
costInvoiceIngredientData: [
|
|
{ factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
|
|
{ factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
|
|
@@ -737,6 +757,11 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
if (res.success) {
|
|
if (res.success) {
|
|
this.fabricLoss = res.result;
|
|
this.fabricLoss = res.result;
|
|
|
|
+ this.costInvoiceClothesColumns =JSON.parse(JSON.stringify(this.costInvoiceClothesColumnsAll));
|
|
|
|
+ // 获取原币和本币金额是否完全相同,完全相同隐藏美元列
|
|
|
|
+ var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
|
|
|
|
+ if (findList.length == 0)
|
|
|
|
+ this.costInvoiceClothesColumns.splice(3,1);
|
|
// console.log('染损列表', this.dyeLossRateData)
|
|
// console.log('染损列表', this.dyeLossRateData)
|
|
}else{
|
|
}else{
|
|
this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]};
|
|
this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]};
|
|
@@ -861,8 +886,6 @@ export default {
|
|
|
|
|
|
// 开票成本-成衣 ----合计行
|
|
// 开票成本-成衣 ----合计行
|
|
clothesFooterShow(data) {
|
|
clothesFooterShow(data) {
|
|
- console.log('开票成本-成衣 ----合计行')
|
|
|
|
- console.log('data', data)
|
|
|
|
return (
|
|
return (
|
|
<a-table
|
|
<a-table
|
|
rowKey={Math.random}
|
|
rowKey={Math.random}
|
|
@@ -875,6 +898,20 @@ export default {
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 开票成本-辅料 ----合计行
|
|
|
|
+ assistFooterShow(data) {
|
|
|
|
+ return (
|
|
|
|
+ <a-table
|
|
|
|
+ rowKey={Math.random}
|
|
|
|
+ bordered={false}
|
|
|
|
+ pagination={false}
|
|
|
|
+ columns={this.costInvoiceIngredientColumns}
|
|
|
|
+ dataSource={this.assistFooterDataSource || []}
|
|
|
|
+ showHeader={false}
|
|
|
|
+ ></a-table>
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+
|
|
// 成衣-发票数量
|
|
// 成衣-发票数量
|
|
clInvoiceQuantityCustomCell(record) {
|
|
clInvoiceQuantityCustomCell(record) {
|
|
return {
|
|
return {
|
|
@@ -965,12 +1002,43 @@ export default {
|
|
},
|
|
},
|
|
clothesFooterDataSource() {
|
|
clothesFooterDataSource() {
|
|
// 开票成本-面料 合计
|
|
// 开票成本-面料 合计
|
|
- const total = Object.assign({}, this.costInvoiceClothesData[0])
|
|
|
|
- for (const attr in total) {
|
|
|
|
- total[attr] = '合计'
|
|
|
|
- break
|
|
|
|
|
|
+ var item = {
|
|
|
|
+ "cpbvcode":"合计"
|
|
|
|
+ };
|
|
|
|
+ var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
|
|
|
|
+ for (let row of this.fabricLoss.fabricCostClothesList){
|
|
|
|
+ isum += row.isum*1;
|
|
|
|
+ ioriSum += row.ioriSum*1;
|
|
|
|
+ iquantity += row.iquantity*1;
|
|
|
|
+ ipbvquantity += row.ipbvquantity*1;
|
|
}
|
|
}
|
|
- return [total]
|
|
|
|
|
|
+
|
|
|
|
+ item.isum= parseFloat(isum.toFixed(2));
|
|
|
|
+ item.ioriSum = parseFloat(ioriSum.toFixed(2));
|
|
|
|
+ item.iquantity = parseFloat(iquantity.toFixed(4));
|
|
|
|
+ item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
|
|
|
|
+ return [item]
|
|
|
|
+ },
|
|
|
|
+ assistFooterDataSource() {
|
|
|
|
+ // 开票成本-辅料 合计
|
|
|
|
+ var item = {
|
|
|
|
+ "caccount":"合计"
|
|
|
|
+ };
|
|
|
|
+ var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
|
|
|
|
+ for (let row of this.fabricLoss.fabricCostAssistList){
|
|
|
|
+ isum += row.isum*1;
|
|
|
|
+ ioriSum += row.ioriSum*1;
|
|
|
|
+ iquantity += row.iquantity*1;
|
|
|
|
+ iquantityIn += row.iquantityIn*1;
|
|
|
|
+ iquantityInvoice += row.iquantityInvoice*1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ item.isum= parseFloat(isum.toFixed(2));
|
|
|
|
+ item.ioriSum = parseFloat(ioriSum.toFixed(2));
|
|
|
|
+ item.iquantity = parseFloat(iquantity.toFixed(4));
|
|
|
|
+ item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
|
|
|
|
+ item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
|
|
|
|
+ return [item]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|