销售订单添加毛利信息

product
bawei 2 years ago
parent 6473a2c330
commit 35187d1a0b

@ -864,6 +864,10 @@ public class SaleorderitemController {
if (ObjectUtils.isNotEmpty(customerEntity) && StringUtils.isNotEmpty(customerEntity.getSupplierNm())){ if (ObjectUtils.isNotEmpty(customerEntity) && StringUtils.isNotEmpty(customerEntity.getSupplierNm())){
vo.setCustomerName(customerEntity.getSupplierNm()); vo.setCustomerName(customerEntity.getSupplierNm());
} }
List<Salesorder_item0Entity> poundlistsalor = saleorderitemService.GetPoundlistSaleOrderItemInfo(id);
vo.setPoundsalesorderList(poundlistsalor);
// Map<String,Object> contractCodeMap = new HashMap<>(); // Map<String,Object> contractCodeMap = new HashMap<>();
// vo.setContractId(generaterSwapUtil.getPopupSelectValue("391146878474963333","id","contract_name",vo.getContractId(),contractCodeMap)); // vo.setContractId(generaterSwapUtil.getPopupSelectValue("391146878474963333","id","contract_name",vo.getContractId(),contractCodeMap));
// Map<String,Object> costomerCodeMap = new HashMap<>(); // Map<String,Object> costomerCodeMap = new HashMap<>();

@ -162,6 +162,19 @@ public class Salesorder_item0Entity {
@TableField(exist = false) @TableField(exist = false)
private String vehicleName; private String vehicleName;
@TableField(exist = false)
private String ticketno;
@TableField(exist = false)
private String purchasePrice;
@TableField(exist = false)
private String aprice;
@TableField(exist = false)
private String maoli;
@TableField(exist = false)
private String pricedifference;
} }

@ -35,4 +35,6 @@ public interface SaleorderitemMapper extends BaseMapper<SaleorderitemEntity> {
double querySaleorderNumStatistics(String date); double querySaleorderNumStatistics(String date);
double querySaleorderAmountStatistics(String date); double querySaleorderAmountStatistics(String date);
List<Salesorder_item0Entity> queryPoundlistSaleOrderItem(String id);
} }

@ -5,6 +5,7 @@ package jnpf.saleorder.model.saleorderitem;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import jnpf.poundlist.entity.PoundlistEntity; import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.saleorder.entity.Salesorder_item0Entity;
import jnpf.saleorder.model.saleorderitem.Salesorder_item0Model; import jnpf.saleorder.model.saleorderitem.Salesorder_item0Model;
import jnpf.saleorder.model.saleorderitem.ReceiptoutsoitemModel; import jnpf.saleorder.model.saleorderitem.ReceiptoutsoitemModel;
import jnpf.saleorder.model.saleorderitem.Arinvoices_item0soitemModel; import jnpf.saleorder.model.saleorderitem.Arinvoices_item0soitemModel;
@ -119,6 +120,10 @@ public class SaleorderitemInfoVO{
@JsonProperty("paymentsoitemList") @JsonProperty("paymentsoitemList")
private List<PaymentsoitemModel> paymentsoitemList; private List<PaymentsoitemModel> paymentsoitemList;
@TableField("Salesorder_item0Entity")
private List<Salesorder_item0Entity> poundsalesorderList;
/** 合同id**/ /** 合同id**/
@TableField("contractId") @TableField("contractId")
private String contractId; private String contractId;

@ -52,5 +52,7 @@ public interface SaleorderitemService extends IService<SaleorderitemEntity> {
double querySaleorderAmountStatistics(String date); double querySaleorderAmountStatistics(String date);
List<Salesorder_item0Entity> GetPoundlistSaleOrderItemInfo(String id);
//列表子表数据方法 //列表子表数据方法
} }

@ -587,6 +587,12 @@ public class SaleorderitemServiceImpl extends ServiceImpl<SaleorderitemMapper, S
return saleorderitemMapper.querySaleorderAmountStatistics(date); return saleorderitemMapper.querySaleorderAmountStatistics(date);
} }
@Override
public List<Salesorder_item0Entity> GetPoundlistSaleOrderItemInfo(String id) {
return saleorderitemMapper.queryPoundlistSaleOrderItem(id);
}
//列表子表数据方法 //列表子表数据方法

@ -117,6 +117,53 @@ FROM
AND a.sales_order_id = #{id} AND a.sales_order_id = #{id}
</select> </select>
<select id="queryPoundlistSaleOrderItem" resultType="jnpf.saleorder.entity.Salesorder_item0Entity">
SELECT
ticketno,
d.item_name,
case
a.pound_type
when 0 then '贸易'
when 1 then '自加工'
when 2 then '委外'
when 3 then '倒运'
else null
end as pound_type,
a.settlement,
ROUND(e.price/( 1+( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )),2) AS purchase_price,
-- ROUND(e.price/( 1+( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END ))*a.settlement,2) AS aprice,
e.not_amount AS aprice,
-- ROUND(purchase_price*a.settlement,2) AS aprice,
ROUND(b.unit_price/( 1+( CASE b.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )),2) AS unit_price,
-- b.unit_price AS unit_price,
-- b.price AS price,
b.no_price AS price,
-- b.no_price-ROUND(purchase_price*a.settlement,2) AS maoli1,
b.no_price-e.not_amount AS maoli,
-- (b.no_price-ROUND(purchase_price*a.settlement,2))/a.settlement AS pricedifference,
ROUND((b.no_price-e.not_amount)/a.settlement,2) AS pricedifference,
case
a.advance
when 0 then '否'
when 1 then '是'
else null
end as advance
FROM
jg_poundlist a
LEFT JOIN jg_salesorder_item0 b ON a.id=b.poundlist_id AND b.delete_mark='0'
LEFT JOIN jg_vehicle c ON a.vehicle_id=c.id AND c.delete_mark='0'
LEFT JOIN jg_material d ON a.material_id=d.id AND d.delete_mark='0'
LEFT JOIN jg_purchaseorder_item0 e ON a.id=e.poundlist_id AND e.delete_mark='0'
WHERE
1=1
AND a.delete_mark='0'
AND
b.sales_order_id=#{id}
</select>
<select id="querySaleorderNumStatistics" resultType="Double"> <select id="querySaleorderNumStatistics" resultType="Double">
select IFNULL(convert(SUM(num),decimal(15,2)), 0) from jg_salesorder where DATE_FORMAT(creator_time,'%Y-%m-%d') = #{date} and (status = '2' OR status = '3') select IFNULL(convert(SUM(num),decimal(15,2)), 0) from jg_salesorder where DATE_FORMAT(creator_time,'%Y-%m-%d') = #{date} and (status = '2' OR status = '3')
</select> </select>

@ -226,7 +226,8 @@
<el-table-column prop="rate" label="税率 " align="center" width="130"> <el-table-column prop="rate" label="税率 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.rate" <el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}' @change="computeNoPrice" disabled> placeholder="请选择" clearable :style='{"width":"100%"}' @change="computeNoPrice"
disabled>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" <el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
@ -285,7 +286,8 @@
<el-table-column prop="issueDate" label="出库日期 " align="center" width="130"> <el-table-column prop="issueDate" label="出库日期 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.issueDate" <el-date-picker v-model="scope.row.issueDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled> placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -328,7 +330,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.unit" <el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in jnpf_jg_collection_jnpf_collectionCountOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in jnpf_jg_collection_jnpf_collectionCountOptions"
:key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -343,7 +347,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.rate" <el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in deleteUserNameOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in deleteUserNameOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -372,7 +377,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.poundType" <el-select v-model="scope.row.poundType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in customerNameOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in customerNameOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -428,7 +434,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.taxRate" <el-select v-model="scope.row.taxRate"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -450,14 +457,16 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.invoiceStatus" <el-select v-model="scope.row.invoiceStatus"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceDate" label="开票日期"> <el-table-column prop="invoiceDate" label="开票日期">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.invoiceDate" <el-date-picker v-model="scope.row.invoiceDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled > placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -487,6 +496,97 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="毛利信息">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.poundsalesorderList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column prop="ticketno" label="车号">
<template slot-scope="scope">
<el-input v-model="scope.row.ticketno"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="poundType" label="类型">
<template slot-scope="scope">
<el-input v-model="scope.row.poundType"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="purchasePrice" label="不含税采购单价">
<template slot-scope="scope">
<el-input v-model="scope.row.purchasePrice"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="aprice" label="不含税采购金额">
<template slot-scope="scope">
<el-input v-model="scope.row.aprice"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="不含税销售单价">
<template slot-scope="scope">
<el-input v-model="scope.row.unitPrice"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="price" label="不含税销售金额">
<template slot-scope="scope">
<el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="maoli" label="不含税毛利">
<template slot-scope="scope">
<el-input v-model="scope.row.maoli"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pricedifference" label="不含税吨差价">
<template slot-scope="scope">
<el-input v-model="scope.row.pricedifference"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="advance" label="是否垫资">
<template slot-scope="scope">
<el-input v-model="scope.row.advance"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="收款信息"> <el-tab-pane label="收款信息">
<el-col :span="24"> <el-col :span="24">
<el-form-item label-width="0"> <el-form-item label-width="0">
@ -505,7 +605,8 @@
<el-table-column prop="businessDate" label="收款时间"> <el-table-column prop="businessDate" label="收款时间">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.businessDate" <el-date-picker v-model="scope.row.businessDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled> placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -520,7 +621,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.paymentType" <el-select v-model="scope.row.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in settlementTypeOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -568,7 +670,8 @@
<el-table-column prop="creatorTime" label="退货日期"> <el-table-column prop="creatorTime" label="退货日期">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime" <el-date-picker v-model="scope.row.creatorTime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled> placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -623,7 +726,8 @@
<el-table-column prop="duedate" label="付款日期"> <el-table-column prop="duedate" label="付款日期">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.duedate" <el-date-picker v-model="scope.row.duedate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled> placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -638,7 +742,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.settlementtype" <el-select v-model="scope.row.settlementtype"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in settlementtypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in settlementtypeOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -716,6 +821,7 @@
collectionsoitemList: [], collectionsoitemList: [],
salesbacksoitemList: [], salesbacksoitemList: [],
paymentsoitemList: [], paymentsoitemList: [],
poundsalesorderList:[],
}, },
activemtmitd: '0', activemtmitd: '0',
rules: rules:

Loading…
Cancel
Save