|
@@ -122,7 +122,7 @@
|
|
|
</div>
|
|
|
<a-table
|
|
|
bordered
|
|
|
- rowKey="id"
|
|
|
+ rowKey="planNum"
|
|
|
:columns="costAllocationColumns"
|
|
|
:data-source="costAllocationData"
|
|
|
:loading="loading"
|
|
@@ -270,9 +270,13 @@ export default {
|
|
|
// 分页查询
|
|
|
getCostList() {
|
|
|
this.$nextTick(() => {
|
|
|
+ this.loading = true
|
|
|
costList(this.queryParam).then(res => {
|
|
|
if (res.success) {
|
|
|
this.costAllocationData = res.result.records
|
|
|
+ this.costAllocationData.map((item,index)=>{
|
|
|
+ this.getSign(item,index)
|
|
|
+ })
|
|
|
this.pagination = {
|
|
|
total: res.result.total,
|
|
|
current: res.result.current,
|
|
@@ -281,9 +285,74 @@ export default {
|
|
|
}else{
|
|
|
this.$message.error(res.message);
|
|
|
}
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ getSign(item,index){
|
|
|
+ var rmbExportamoun = 0,
|
|
|
+ fabriccostIncludestax = 0,
|
|
|
+ fabriccostNotincludestax = 0,
|
|
|
+ excipiencostNotincludestax = 0,
|
|
|
+ rmbProcesscost = 0,
|
|
|
+ rmbExpense=0,
|
|
|
+ usdTotalexportprice = 0
|
|
|
+ //发运明细相关数据
|
|
|
+ var processCostAll = 0
|
|
|
+ item.syCostAllocation.processUnitList[0].syCostAllocationShipdetail.map((event,index)=>{
|
|
|
+ if(item.syCostAllocation.processUnitList[0].syCostAllocationShipdetail[index].outdata!=='合计'){
|
|
|
+ rmbExportamoun+=Number(event.rmbAmount)
|
|
|
+ processCostAll+=Number(event.processCost)
|
|
|
+ usdTotalexportprice+=(event.exportPrice)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(Number(item.syCostAllocation.processUnitList[0].syCostAllocationShipdetail[0].procesUnitPriceusd)>0){
|
|
|
+ rmbProcesscost =processCostAll//出运不含税加工费-合计信息
|
|
|
+ }else{
|
|
|
+ rmbProcesscost=(processCostAll/(1+(Number(item.syCostAllocation.taxrate)/100))).toFixed(2)//出运不含税加工费
|
|
|
+ }
|
|
|
+ //面料sheet相关数据
|
|
|
+ var all = 0,//面料sheet-转入成本总计
|
|
|
+ allYu = 0//面料sheet-余下数量成本总计
|
|
|
+ item.syCostAllocation.processUnitList[0].syCostAllocationFabricList.map((event1,index)=>{
|
|
|
+ if(event1.remainingQuantitycost!=='' && event1.remainingQuantitycost){
|
|
|
+ event1.remainingQuantitycost = Number(event1.remainingQuantitycost).toFixed(2)
|
|
|
+ allYu +=Number(event1.remainingQuantitycost)
|
|
|
+ }
|
|
|
+ if(event1.transferCost&&event1.transferCost!==''){
|
|
|
+ all+=Number(event1.transferCost)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ fabriccostIncludestax=(all+Number(item.syCostAllocation.fabriccostIncludestax)-allYu).toFixed(2)
|
|
|
+ fabriccostNotincludestax = (fabriccostIncludestax/(1+(Number(item.syCostAllocation.taxrate)/100))).toFixed(2)
|
|
|
+ //辅料sheet相关数据
|
|
|
+ var priceExcludingtaxAll = 0,
|
|
|
+ transferCostAll=0
|
|
|
+ item.syCostAllocation.processUnitList[0].syCostAllocationIngredientList.map((event2,index)=>{
|
|
|
+ if(item.syCostAllocation.processUnitList[0].syCostAllocationIngredientList[index].goodsName!=='合计'){
|
|
|
+ priceExcludingtaxAll+=event2.priceExcludingtax?Number(event2.priceExcludingtax):0,
|
|
|
+ transferCostAll+=event2.transferCost?Number(event2.transferCost):0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ excipiencostNotincludestax=((priceExcludingtaxAll+transferCostAll)/(1+(Number((item.syCostAllocation.taxrate)/100)))).toFixed(2)
|
|
|
+ //费用支出sheet相关数据
|
|
|
+ var disbursedLocalmoneyALL=0,
|
|
|
+ shuiemoneyAll = 0
|
|
|
+ item.syCostAllocation.syCostAllocationCostpayList.map((event3,index)=>{
|
|
|
+ if(item.syCostAllocation.syCostAllocationCostpayList[index].setNo!=='合计'){
|
|
|
+ disbursedLocalmoneyALL+=event3.disbursedLocalmoney?Number(event3.disbursedLocalmoney):0
|
|
|
+ shuiemoneyAll+=Number(event3.shuiemoney)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ rmbExpense = (disbursedLocalmoneyALL+shuiemoneyAll).toFixed(2)
|
|
|
+ // 标记A
|
|
|
+ var A =rmbExportamoun-fabriccostNotincludestax-excipiencostNotincludestax-rmbProcesscost-rmbExpense
|
|
|
+ var B = A/usdTotalexportprice
|
|
|
+ B= B>0?B:-B
|
|
|
+ item.signA = A<0?'red':'black'
|
|
|
+ item.signB = B<0.8?'blue':'black'
|
|
|
+ },
|
|
|
cancelSumit(record){
|
|
|
var syApprovalHistory={
|
|
|
stuta:'取消提交',
|
|
@@ -314,13 +383,16 @@ export default {
|
|
|
this.$refs.attachment.AttachmentModVis = true
|
|
|
var attachmentArr = record.attachs.split(',')
|
|
|
var attachList = [];
|
|
|
- attachmentArr.forEach(item=>{
|
|
|
- var attach = {};
|
|
|
- attach.name = item;
|
|
|
- attach.src=item;
|
|
|
- attachList.push(attach);
|
|
|
- })
|
|
|
- this.$refs.attachment.attachmentData = attachList;
|
|
|
+ if (attachmentArr.length!==0) {
|
|
|
+ attachmentArr.forEach(item=>{
|
|
|
+ var attach = {};
|
|
|
+ attach.name = item;
|
|
|
+ attach.src=item;
|
|
|
+ attachList.push(attach);
|
|
|
+ })
|
|
|
+ this.$refs.attachment.attachmentData = attachList;
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
// 审核
|
|
|
check(record) {
|