# Conflicts:
#	jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/entity/BusinessOrderEntity.java
jg-waiwang-pro
XI_TENG\xixi_ 4 months ago
commit 805bd7b54a

@ -106,8 +106,7 @@
</u-button>
</template>
<u-button class="buttom-btn" type="primary" v-if="config.opType == 1&&properties.hasAuditBtn"
@click.stop="eventLauncher('audit')">
{{properties.auditBtnText||'通过'}}
@click.stop="eventLauncher('audit')">审批
</u-button>
<u-button class="buttom-btn" type="error" @click.stop="eventReceiver({},'recall')"
v-if="config.opType == 2 && properties.hasRevokeBtn">

@ -451,9 +451,8 @@
i.f_real_name AS realName,
i1.f_real_name AS realNameA,
b.NAME AS subjectName,
c.CODE AS saleCode,
CASE
c.STATUS
m.STATUS
when '1' then '待提交'
when '2' then '待审核'
when '3' then '待锁定'
@ -465,13 +464,13 @@
END AS saleStatus,
d.contract_name AS contractName,
f.storageNum,
j.name as wareHouseName
j.name as wareHouseName,
k.sale_contract_no as saleContractNo,
m.code as saleCode
FROM
jg_business_order a
LEFT JOIN jg_subject_basic b ON a.first_subject_basic_id = b.id
AND b.f_delete_mark
IS NULL LEFT JOIN jg_business_order c ON a.correlated_order_id = c.id
AND c.f_delete_mark
IS NULL LEFT JOIN jg_contract d ON a.contract_id = d.id
AND d.f_delete_mark
IS NULL LEFT JOIN jg_business_order_product_relational e ON e.business_order_id = a.id
@ -496,6 +495,9 @@
LEFT JOIN base_user i1 ON i1.F_Id = a.f_last_modify_user_id and i1.f_delete_mark is null
LEFT JOIN jg_business_line j ON a.delivery_warehouse = j.id
AND j.f_delete_mark is null
LEFT JOIN jg_voucher k ON a.id = k.business_order_id and k.f_delete_mark is null
LEFT JOIN jg_purchase_sale_relation l ON a.id = l.purchase_order_id
LEFT JOIN jg_business_order m ON l.sale_order_id = m.id AND m.f_delete_mark is null
${ew.customSqlSegment}
GROUP BY
a.id

@ -99,406 +99,266 @@
<select id="getWarehousingstorageList1" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
LEFT JOIN jg_business_order h on g.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
<select id="getWarehousingstorageList2" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
LEFT JOIN jg_return_cargo_order p ON g.business_id = p.id
LEFT JOIN jg_business_order h on p.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
<select id="getWarehousingstorageList3" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_receipt_order g ON b.warehousing_id = g.id
LEFT JOIN jg_return_cargo_order p ON g.business_id = p.id
LEFT JOIN jg_business_order h on p.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
<select id="getWarehousingstorageList4" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
l.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_receipt_order g ON b.warehousing_id = g.id
LEFT JOIN jg_business_order h on g.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_warehousing_storage_product l on l.warehousing_storage_id = b.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY a.id
))
</select>
<select id="getWarehousingstorageList5" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
LEFT JOIN jg_business_order h on g.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
<select id="getWarehousingstorageList6" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
LEFT JOIN jg_return_cargo_order p ON p.id = g.business_id
LEFT JOIN jg_business_order h on p.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
<select id="getWarehousingstorageList7" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
l.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_delivery_order g ON b.warehousing_id = g.id
LEFT JOIN jg_business_order h on g.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_warehousing_outbound_product l on l.warehousing_outbound_id = b.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY a.id
))
</select>
<select id="getWarehousingstorageList8" resultType="jnpf.entity.CwaccountvoucherEntity">
SELECT b.document_no orderId,
c.order_no orderNo,
c.voucher_code voucherCode,
c.id voucherId,
c.document_type documentType,
c.voucher_type voucherType,
c.pound_code poundCode,
d.driver_name driverName,
e.id vehicleId,
e.vehicle_number vehicleName,
c.poundlist_time poundlistTime,
f.product_id productId,
f.spec spec,
f.unit unit,
IFNULL(f.gross_weight,0) grossWeight,
IFNULL(f.tare_weight,0) tareWeight,
IFNULL(f.buckle_weight,0) buckleWeight,
IFNULL(f.net_weight,0) netWeight,
-- subtotal_weight小计重量
IFNULL(j.tax_rate,13) rate,
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
LEFT JOIN jg_delivery_order g ON b.warehousing_id = g.id
LEFT JOIN jg_return_cargo_order p ON p.id = g.business_id
LEFT JOIN jg_business_order h on p.business_id = h.id
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
SELECT
product_id productId,
b.spec spec,
a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit,
a.business_num settlementSum,
a.business_price settlementPrice,
a.tax_count settlementSubtotal,
a.tax rate,
a.not_tax_price settlementPriceNo,
a.not_tax_count settlementSubtotalNo,
a.tax_count settlementTotal,
a.not_tax_count settlementTotalNo
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
WHERE
a.business_order_id IN (
SELECT
id
FROM
jg_business_order
WHERE
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
#{item}
</foreach>
))
</select>
</mapper>

@ -712,4 +712,10 @@
from jg_voucher a
where a.f_delete_mark is null and a.is_transfer = '2' and a.business_order_id = #{id}
</select>
<update id="updateByVoucherCode">
update jg_voucher set order_no = #{voucherEntity.orderNo}
where voucher_code = #{voucherEntity.voucherCode}
</update>
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.PurchaseSaleRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* purchaseSaleRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-27
*/
public interface PurchaseSaleRelationMapper extends BaseMapper<PurchaseSaleRelationEntity> {
}

@ -51,4 +51,6 @@ public interface VoucherMapper extends BaseMapper<VoucherEntity> {
BigDecimal queryVoucherByBusinessOrder(@Param("id") String id);
Map<String ,BigDecimal> queryAmountByBusinessOrder(@Param("id") String id);
void updateByVoucherCode(@Param("voucherEntity") VoucherEntity voucherEntity);
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.purchasesalerelation.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* purchaseSaleRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-27
*/
public interface PurchaseSaleRelationService extends IService<PurchaseSaleRelationEntity> {
List<PurchaseSaleRelationEntity> getList(PurchaseSaleRelationPagination purchaseSaleRelationPagination);
List<PurchaseSaleRelationEntity> getTypeList(PurchaseSaleRelationPagination purchaseSaleRelationPagination,String dataType);
PurchaseSaleRelationEntity getInfo(String id);
void delete(PurchaseSaleRelationEntity entity);
void create(PurchaseSaleRelationEntity entity);
boolean update(String id, PurchaseSaleRelationEntity entity);
//子表方法
//副表数据方法
String checkForm(PurchaseSaleRelationForm form,int i);
void saveOrUpdate(PurchaseSaleRelationForm purchaseSaleRelationForm,String id, boolean isSave) throws Exception;
}

@ -78,4 +78,6 @@ public interface VoucherService extends IService<VoucherEntity> {
BigDecimal queryVoucherProductNetWeightInfo(String id);
BigDecimal queryVoucherByBusinessOrderInfo(String id);
Map<String, BigDecimal> queryAmountByBusinessOrder(String id);
void updateByVoucherCode(VoucherEntity voucherEntity);
}

@ -120,6 +120,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
private SubjectbasicService subjectbasicService;
@Resource
private VoucherProductMapper voucherProductMapper;
@Autowired
private PurchaseSaleRelationService purchaseSaleRelationService;
@Override
public List<BusinessOrderEntity> getList(BusinessOrderPagination businessOrderPagination){
@ -1150,10 +1152,17 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
businessOrderMapper.updateById(entity);
}
//更新采购订单/销售订单的转换状态
if (StringUtil.isNotEmpty(entity.getIsTransferSource())){
BusinessOrderEntity businessOrderEntity = businessOrderMapper.selectById(entity.getIsTransferSource());
businessOrderEntity.setIsTransfer("2");
businessOrderMapper.updateById(businessOrderEntity);
if (entity.getIsTransferSource() != null && entity.getIsTransferSource().size() > 0){
for (String s : entity.getIsTransferSource()) {
BusinessOrderEntity businessOrderEntity = businessOrderMapper.selectById(s);
businessOrderEntity.setIsTransfer("2");
businessOrderMapper.updateById(businessOrderEntity);
PurchaseSaleRelationEntity purchaseSaleRelationEntity = new PurchaseSaleRelationEntity();
purchaseSaleRelationEntity.setId(RandomUtil.uuId());
purchaseSaleRelationEntity.setPurchaseOrderId(s);
purchaseSaleRelationEntity.setSaleOrderId(entity.getId());
purchaseSaleRelationService.save(purchaseSaleRelationEntity);
}
}
//添加流程状态
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(entity.getId()), FlowTaskEntity::getStatus);

@ -384,10 +384,10 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
cwaccountQueryWrapper.lambda().eq(CwaccountEntity::getBusinessType,cwaccountPagination.getBusinessType());
}
if(ObjectUtil.isNotEmpty(cwaccountPagination.getContractCode())){
if(cwaccountPagination.getContractCodeList() != null && cwaccountPagination.getContractCodeList().size() > 0){
cwaccountNum++;
cwaccountQueryWrapper.lambda().eq(CwaccountEntity::getContractCode,cwaccountPagination.getContractCode());
cwaccountQueryWrapper.lambda().in(CwaccountEntity::getContractCode,cwaccountPagination.getContractCodeList());
}
if(ObjectUtil.isNotEmpty(cwaccountPagination.getAccountState())){
@ -673,82 +673,6 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
if (form.getCwaccountstorageList()==null || form.getCwaccountstorageList().size() == 0){
return "出入库单信息不能为空";
}
if (form.getCwaccountvoucherList()!=null && form.getCwaccountvoucherList().size() > 0){
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getBucklesWeight())){
t.setBucklesWeight(t.getBucklesWeight().trim());
}
else{
return "凭证信息-扣杂重量不能为空";
}
/*if(StringUtil.isNotEmpty(t.getBucklesWeight())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getBucklesWeight())).matches()){
return "请输入正确的金额";
}
}*/
}
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getSettlementSum())){
t.setSettlementSum(t.getSettlementSum().trim());
}
else{
return "凭证信息-结算数量不能为空";
}
/*if(StringUtil.isNotEmpty(t.getSettlementSum())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getSettlementSum())).matches()){
return "请输入正确的金额";
}
}*/
}
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getSettlementPrice())){
t.setSettlementPrice(t.getSettlementPrice().trim());
}
else{
return "凭证信息-结算单价(含税)不能为空";
}
/*if(StringUtil.isNotEmpty(t.getSettlementPrice())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getSettlementPrice())).matches()){
return "请输入正确的金额";
}
}*/
}
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getSettlementSubtotal())){
t.setSettlementSubtotal(t.getSettlementSubtotal().trim());
}
else{
return "凭证信息-结算小计(含税)不能为空";
}
/*if(StringUtil.isNotEmpty(t.getSettlementSubtotal())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getSettlementSubtotal())).matches()){
return "请输入正确的金额";
}
}*/
}
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getSettlementPriceNo())){
t.setSettlementPriceNo(t.getSettlementPriceNo().trim());
}
/*if(StringUtil.isNotEmpty(t.getSettlementPriceNo())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getSettlementPriceNo())).matches()){
return "请输入正确的金额";
}
}*/
}
for(CwaccountvoucherModel t : form.getCwaccountvoucherList()){
if(StringUtil.isNotEmpty(t.getOtherExpenses())){
t.setOtherExpenses(t.getOtherExpenses().trim());
}
/*if(StringUtil.isNotEmpty(t.getOtherExpenses())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getOtherExpenses())).matches()){
return "请输入正确的金额";
}
}*/
}
}else{
return "凭证信息不能为空";
}
if (form.getCwaccountsummaryList()==null || form.getCwaccountsummaryList().size() == 0){
return "汇总信息不能为空";
}

@ -431,15 +431,14 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
PaymentApplicationEntity entity = JsonUtil.getJsonToBean(paymentApplicationForm, PaymentApplicationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
String mainId = id ;
entity.setCode(generaterSwapUtil.getBillNumber("FKSQ", false));
entity.setId(mainId);
entity.setFlowId(paymentApplicationForm.getFlowId());
entity.setVersion(0);
}else{
entity.setCode(generaterSwapUtil.getBillNumber("FKSQ", false));
}
if(paymentApplicationForm.getPaymentapplicationsettlementList()!=null && paymentApplicationForm.getPaymentapplicationsettlementList().size()>0){
//entity.set
entity.setFlowId(paymentApplicationForm.getFlowId());
}
this.saveOrUpdate(entity);

@ -0,0 +1,255 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.PurchaseSaleRelationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.purchasesalerelation.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* purchaseSaleRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-27
*/
@Service
public class PurchaseSaleRelationServiceImpl extends ServiceImpl<PurchaseSaleRelationMapper, PurchaseSaleRelationEntity> implements PurchaseSaleRelationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<PurchaseSaleRelationEntity> getList(PurchaseSaleRelationPagination purchaseSaleRelationPagination){
return getTypeList(purchaseSaleRelationPagination,purchaseSaleRelationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<PurchaseSaleRelationEntity> getTypeList(PurchaseSaleRelationPagination purchaseSaleRelationPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? PurchaseSaleRelationConstant.getAppColumnData() : PurchaseSaleRelationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int purchaseSaleRelationNum =0;
QueryWrapper<PurchaseSaleRelationEntity> purchaseSaleRelationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(purchaseSaleRelationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = purchaseSaleRelationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<PurchaseSaleRelationEntity> purchaseSaleRelationSuperWrapper = new QueryWrapper<>();
purchaseSaleRelationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(purchaseSaleRelationSuperWrapper,PurchaseSaleRelationEntity.class,queryJson,"0"));
int purchaseSaleRelationNum1 = purchaseSaleRelationSuperWrapper.getExpression().getNormal().size();
if (purchaseSaleRelationNum1>0){
List<String> purchaseSaleRelationList =this.list(purchaseSaleRelationSuperWrapper).stream().map(PurchaseSaleRelationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(purchaseSaleRelationList);
intersectionSuperList.add(purchaseSaleRelationList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<PurchaseSaleRelationEntity> purchaseSaleRelationSuperWrapper = new QueryWrapper<>();
purchaseSaleRelationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(purchaseSaleRelationSuperWrapper,PurchaseSaleRelationEntity.class,ruleJson,"0"));
int purchaseSaleRelationNum1 = purchaseSaleRelationSuperWrapper.getExpression().getNormal().size();
if (purchaseSaleRelationNum1>0){
List<String> purchaseSaleRelationList =this.list(purchaseSaleRelationSuperWrapper).stream().map(PurchaseSaleRelationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(purchaseSaleRelationList);
intersectionRuleList.add(purchaseSaleRelationList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseSaleRelationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(purchaseSaleRelationQueryWrapper,PurchaseSaleRelationEntity.class,purchaseSaleRelationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(purchaseSaleRelationObj)){
return new ArrayList<>();
} else {
purchaseSaleRelationQueryWrapper = (QueryWrapper<PurchaseSaleRelationEntity>)purchaseSaleRelationObj;
if( purchaseSaleRelationQueryWrapper.getExpression().getNormal().size()>0){
purchaseSaleRelationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseSaleRelationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(purchaseSaleRelationQueryWrapper,PurchaseSaleRelationEntity.class,purchaseSaleRelationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(purchaseSaleRelationObj)){
return new ArrayList<>();
} else {
purchaseSaleRelationQueryWrapper = (QueryWrapper<PurchaseSaleRelationEntity>)purchaseSaleRelationObj;
if( purchaseSaleRelationQueryWrapper.getExpression().getNormal().size()>0){
purchaseSaleRelationNum++;
}
}
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
purchaseSaleRelationQueryWrapper.lambda().in(PurchaseSaleRelationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
purchaseSaleRelationQueryWrapper.lambda().and(t->t.in(PurchaseSaleRelationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
purchaseSaleRelationQueryWrapper.lambda().and(t->t.in(PurchaseSaleRelationEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(purchaseSaleRelationPagination.getSidx())){
purchaseSaleRelationQueryWrapper.lambda().orderByDesc(PurchaseSaleRelationEntity::getId);
}else{
try {
String sidx = purchaseSaleRelationPagination.getSidx();
String[] strs= sidx.split("_name");
PurchaseSaleRelationEntity purchaseSaleRelationEntity = new PurchaseSaleRelationEntity();
Field declaredField = purchaseSaleRelationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
purchaseSaleRelationQueryWrapper="asc".equals(purchaseSaleRelationPagination.getSort().toLowerCase())?purchaseSaleRelationQueryWrapper.orderByAsc(value):purchaseSaleRelationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<PurchaseSaleRelationEntity> page=new Page<>(purchaseSaleRelationPagination.getCurrentPage(), purchaseSaleRelationPagination.getPageSize());
IPage<PurchaseSaleRelationEntity> userIPage=this.page(page, purchaseSaleRelationQueryWrapper);
return purchaseSaleRelationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PurchaseSaleRelationEntity> list = new ArrayList();
return purchaseSaleRelationPagination.setData(list, list.size());
}
}else{
return this.list(purchaseSaleRelationQueryWrapper);
}
}
@Override
public PurchaseSaleRelationEntity getInfo(String id){
QueryWrapper<PurchaseSaleRelationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(PurchaseSaleRelationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(PurchaseSaleRelationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, PurchaseSaleRelationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(PurchaseSaleRelationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(PurchaseSaleRelationForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
return countRecover;
}
/**
* ()
* @param id
* @param purchaseSaleRelationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(PurchaseSaleRelationForm purchaseSaleRelationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
purchaseSaleRelationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(PurchaseSaleRelationConstant.getFormData(),purchaseSaleRelationForm),PurchaseSaleRelationForm.class);
PurchaseSaleRelationEntity entity = JsonUtil.getJsonToBean(purchaseSaleRelationForm, PurchaseSaleRelationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -1079,13 +1079,36 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
voucherEntity.setSaleAmount(new BigDecimal(model.getSaleAmount()));//销售额
//根据合同编号取查合同
QueryWrapper<ContractLEntity> contractLQueryWrapper=new QueryWrapper<>();
contractLQueryWrapper.lambda().eq(ContractLEntity::getContractNumber, voucherEntity.getPurchaseContractNo());
if(voucherEntity.getBusinessType().equals("1")){
contractLQueryWrapper.lambda().eq(ContractLEntity::getContractNumber, voucherEntity.getPurchaseContractNo());
}else{
contractLQueryWrapper.lambda().eq(ContractLEntity::getContractNumber, voucherEntity.getSaleContractNo());
}
List<ContractLEntity> contractLEntityList = contractLService.list(contractLQueryWrapper);
if(contractLEntityList != null && contractLEntityList.size() > 0){
if(voucherEntity.getBusinessType().equals("1")){
if(voucherEntity.getDocumentType().equals("1")){
//采购收货
voucherEntity.setCustomerId(contractLEntityList.get(0).getDeptId());
voucherEntity.setSupplierId(contractLEntityList.get(0).getSubject());
}else{
//采购发货
voucherEntity.setCustomerId(contractLEntityList.get(0).getSubject());
voucherEntity.setSupplierId(contractLEntityList.get(0).getDeptId());
}
}else{
if(voucherEntity.getDocumentType().equals("1")){
//销售收货
voucherEntity.setCustomerId(contractLEntityList.get(0).getDeptId());
voucherEntity.setSupplierId(contractLEntityList.get(0).getSubject());
}else{
//销售发货
voucherEntity.setCustomerId(contractLEntityList.get(0).getSubject());
voucherEntity.setSupplierId(contractLEntityList.get(0).getDeptId());
}
}
voucherEntity.setModeTransport(contractLEntityList.get(0).getModeTransport());//运输方式
voucherEntity.setCustomerId(contractLEntityList.get(0).getDeptId());
voucherEntity.setCustomerName("");
voucherEntity.setSupplierId(contractLEntityList.get(0).getSubject());
voucherEntity.setSupplierName("");
}else{
num ++;
@ -1364,4 +1387,9 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
public Map<String, BigDecimal> queryAmountByBusinessOrder(String id) {
return voucherMapper.queryAmountByBusinessOrder(id);
}
@Override
public void updateByVoucherCode(VoucherEntity voucherEntity) {
voucherMapper.updateByVoucherCode(voucherEntity);
}
}

@ -0,0 +1,190 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.purchasesalerelation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* purchaseSaleRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-27
*/
@Slf4j
@RestController
@Tag(name = "purchaseSaleRelation" , description = "scm")
@RequestMapping("/api/scm/PurchaseSaleRelation")
public class PurchaseSaleRelationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private PurchaseSaleRelationService purchaseSaleRelationService;
/**
*
*
* @param purchaseSaleRelationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody PurchaseSaleRelationPagination purchaseSaleRelationPagination)throws IOException{
List<PurchaseSaleRelationEntity> list= purchaseSaleRelationService.getList(purchaseSaleRelationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (PurchaseSaleRelationEntity entity : list) {
Map<String, Object> purchaseSaleRelationMap=JsonUtil.entityToMap(entity);
purchaseSaleRelationMap.put("id", purchaseSaleRelationMap.get("id"));
//副表数据
//子表数据
realList.add(purchaseSaleRelationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, PurchaseSaleRelationConstant.getFormData(), PurchaseSaleRelationConstant.getColumnData(), purchaseSaleRelationPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(purchaseSaleRelationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param purchaseSaleRelationForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid PurchaseSaleRelationForm purchaseSaleRelationForm) {
String b = purchaseSaleRelationService.checkForm(purchaseSaleRelationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
purchaseSaleRelationService.saveOrUpdate(purchaseSaleRelationForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param purchaseSaleRelationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PurchaseSaleRelationForm purchaseSaleRelationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
purchaseSaleRelationForm.setId(id);
if (!isImport) {
String b = purchaseSaleRelationService.checkForm(purchaseSaleRelationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
PurchaseSaleRelationEntity entity= purchaseSaleRelationService.getInfo(id);
if(entity!=null){
try{
purchaseSaleRelationService.saveOrUpdate(purchaseSaleRelationForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
PurchaseSaleRelationEntity entity= purchaseSaleRelationService.getInfo(id);
if(entity!=null){
//主表数据删除
purchaseSaleRelationService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
PurchaseSaleRelationEntity entity= purchaseSaleRelationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> purchaseSaleRelationMap=JsonUtil.entityToMap(entity);
purchaseSaleRelationMap.put("id", purchaseSaleRelationMap.get("id"));
//副表数据
//子表数据
purchaseSaleRelationMap = generaterSwapUtil.swapDataDetail(purchaseSaleRelationMap,PurchaseSaleRelationConstant.getFormData(),"576073976149723909",false);
return ActionResult.success(purchaseSaleRelationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
PurchaseSaleRelationEntity entity= purchaseSaleRelationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> purchaseSaleRelationMap=JsonUtil.entityToMap(entity);
purchaseSaleRelationMap.put("id", purchaseSaleRelationMap.get("id"));
//副表数据
//子表数据
purchaseSaleRelationMap = generaterSwapUtil.swapDataForm(purchaseSaleRelationMap,PurchaseSaleRelationConstant.getFormData(),PurchaseSaleRelationConstant.TABLEFIELDKEY,PurchaseSaleRelationConstant.TABLERENAMES);
return ActionResult.success(purchaseSaleRelationMap);
}
}

@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.model.voucher.*;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
@ -73,7 +74,8 @@ public class VehicleController {
@Autowired
private VehicleDriverService vehicleDriverService;
@Autowired
private VoucherService voucherService;
@Autowired
private ConfigValueUtil configValueUtil;
@ -370,4 +372,194 @@ public class VehicleController {
return ActionResult.success(vehicleMap);
}
@Operation(summary = "上传文件")
@PostMapping("/Uploader")
public ActionResult<Object> Uploader() {
List<MultipartFile> list = UpUtil.getFileAll();
MultipartFile file = list.get(0);
if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) {
String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath());
String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file));
//上传文件
FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName);
DownloadVO vo = DownloadVO.builder().build();
vo.setName(fileInfo.getFilename());
return ActionResult.success(vo);
} else {
return ActionResult.fail("选择文件不符合导入");
}
}
/**
*
*
* @return
*/
@Operation(summary = "模板下载")
@GetMapping("/TemplateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
DownloadVO vo = DownloadVO.builder().build();
UserInfo userInfo = userProvider.get();
Map<String, Object> dataMap = new HashMap<>();
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("凭证编号" ,"voucherCode"));
entitys.add(new ExcelExportEntity("订单序号" ,"orderNo"));
entitys.add(new ExcelExportEntity("单据类型" ,"documentType"));
entitys.add(new ExcelExportEntity("凭证类型" ,"voucherType"));
entitys.add(new ExcelExportEntity("凭证状态" ,"voucherStatus"));
entitys.add(new ExcelExportEntity("磅单编号" ,"poundCode"));
entitys.add(new ExcelExportEntity("关联单据号" ,"associatedDocumentNo"));
entitys.add(new ExcelExportEntity("车牌号" ,"vehicleName"));
entitys.add(new ExcelExportEntity("运输方式" ,"modeTransport"));
entitys.add(new ExcelExportEntity("承运方式" ,"transportationMethod"));
entitys.add(new ExcelExportEntity("承运商" ,"carrier"));
entitys.add(new ExcelExportEntity("运费" ,"freight"));
entitys.add(new ExcelExportEntity("起运地" ,"placeDispatch"));
entitys.add(new ExcelExportEntity("到达地" ,"destination"));
entitys.add(new ExcelExportEntity("三级供应商" ,"thirdSupplyName"));
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
ExportParams exportParams = new ExportParams(null, "凭证单模板");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(VoucherConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "凭证单模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("模板信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return ActionResult.success(vo);
}
/**
*
*
* @return
*/
@Operation(summary = "导入预览" )
@GetMapping("/ImportPreview")
public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception {
Map<String, Object> headAndDataMap = new HashMap<>(2);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 1;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setHeadRows(headerRowIndex);
params.setNeedVerify(true);
try {
List<VoucherExcelVO333> excelDataList = ExcelImportUtil.importExcel(temporary, VoucherExcelVO333.class, params);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("voucherCode","凭证编号"));
columns.add(new ExcelImFieldModel("orderNo","订单序号"));
columns.add(new ExcelImFieldModel("documentType","单据类型"));
columns.add(new ExcelImFieldModel("voucherType","凭证类型"));
columns.add(new ExcelImFieldModel("preparationTime","制单时间"));
columns.add(new ExcelImFieldModel("poundCode","磅单编号"));
columns.add(new ExcelImFieldModel("vehicleName","车牌号"));
columns.add(new ExcelImFieldModel("supplierName","发货单位"));
columns.add(new ExcelImFieldModel("customerName","收货单位"));
columns.add(new ExcelImFieldModel("modeTransport","运输方式"));
columns.add(new ExcelImFieldModel("transportationMethod","承运方式"));
columns.add(new ExcelImFieldModel("carrier","承运商"));
columns.add(new ExcelImFieldModel("placeDispatch","起运地"));
columns.add(new ExcelImFieldModel("destination","到达地"));
columns.add(new ExcelImFieldModel("freight","运费"));
columns.add(new ExcelImFieldModel("voucherStatus","凭证状态"));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){
e.printStackTrace();
return ActionResult.fail("表头名称不可更改,表头行不能删除");
}
return ActionResult.success(headAndDataMap);
}
/**
*
*
* @return
*/
@Operation(summary = "导入数据" )
@PostMapping("/ImportData")
public ActionResult<ExcelImportModel> ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception {
List<Map<String, Object>> listData=new ArrayList<>();
for(Map<String, Object> map : visualImportModel.getList()){
voucherService.updateByVoucherCode(JsonUtil.getJsonToBean(map, VoucherEntity.class));
}
ExcelImportModel excelImportModel = new ExcelImportModel();
excelImportModel.setSnum(visualImportModel.getList().size());
excelImportModel.setFnum(0);
excelImportModel.setResultType(0);
return ActionResult.success(excelImportModel);
}
/**
*
*
* @return
*/
@Operation(summary = "导出异常报告")
@PostMapping("/ImportExceptionData")
public ActionResult<DownloadVO> ImportExceptionData(@RequestBody VisualImportModel visualImportModel) {
DownloadVO vo=DownloadVO.builder().build();
List<VoucherExcelErrorVO> voucherVOList = JsonUtil.getJsonToList(visualImportModel.getList(), VoucherExcelErrorVO.class);
UserInfo userInfo = userProvider.get();
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
ExportParams exportParams = new ExportParams(null, "错误报告");
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams,
VoucherExcelErrorVO.class, voucherVOList);
String fileName = "错误报告" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
e.printStackTrace();
}
return ActionResult.success(vo);
}
}

@ -201,7 +201,7 @@ public class BusinessOrderEntity {
@TableField(exist = false)
private String wareHouseName;
@TableField(exist = false)
private String isTransferSource;
private List<String> isTransferSource;
@TableField(exist = false)
private String settlementMethod1;
@TableField(exist = false)
@ -216,6 +216,10 @@ public class BusinessOrderEntity {
@TableField(exist = false)
private BigDecimal taxCount;
@TableField(exist = false)
private String ordLn;
@TableField(exist = false)
private String saleContractNo;
}

@ -0,0 +1,47 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-27
*/
@Data
@TableName("jg_purchase_sale_relation")
public class PurchaseSaleRelationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "PURCHASE_ORDER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String purchaseOrderId;
@TableField(value = "SALE_ORDER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String saleOrderId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -115,7 +115,7 @@ public class BusinessOrderForm {
private Object businessType;
/** 是否转换采购/销售 */
@JsonProperty("isTransferSource")
private Object isTransferSource;
private List<String> isTransferSource;
/** YG销售方式 */
@JsonProperty("externalSaleWay")
private Object externalSaleWay;

@ -45,7 +45,7 @@ public class CwaccountPagination extends Pagination {
private List<String> excludeIdList;
@JsonProperty("idList")
private List<String> idList;
private String contractCode;
private List<String> contractCodeList;
private String accountState;
@JsonProperty("queryFlowTaskPass")
private String queryFlowTaskPass;

@ -0,0 +1,26 @@
package jnpf.model.purchasesalerelation;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* purchaseSaleRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-27
*/
@Data
public class PurchaseSaleRelationForm {
/** 主键 */
private String id;
/** 采购订单ID **/
@JsonProperty("purchaseOrderId")
private String purchaseOrderId;
/** 销售订单ID **/
@JsonProperty("saleOrderId")
private String saleOrderId;
}

@ -0,0 +1,30 @@
package jnpf.model.purchasesalerelation;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* purchaseSaleRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-27
*/
@Data
public class PurchaseSaleRelationPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
}

@ -26,6 +26,10 @@ public class VoucherExcelVO{
@JSONField(name = "voucherCode")
@Excel(name = "凭证编号" )
private String voucherCode;
/** 订单序号 **/
@JSONField(name = "orderNo")
@Excel(name = "订单序号")
private String orderNo;
/** 凭证类型 **/
@JSONField(name = "voucherType")
@ -102,7 +106,6 @@ public class VoucherExcelVO{
@JSONField(name = "voucherStatus")
@Excel(name = "凭证状态" )
private String voucherStatus;
@JsonProperty("tableField111")
@ExcelCollection(name="",orderNum = "8")
private List<VoucherproductExcelVO> tableField111;

@ -0,0 +1,109 @@
package jnpf.model.voucher;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VoucherExcelVO333 {
/** 凭证编号 **/
@JSONField(name = "voucherCode")
@Excel(name = "凭证编号" )
private String voucherCode;
/** 订单序号 **/
@JSONField(name = "orderNo")
@Excel(name = "订单序号")
private String orderNo;
/** 单据类型 **/
@JSONField(name = "documentType")
@Excel(name = "单据类型")
private String documentType;
/** 凭证类型 **/
@JSONField(name = "voucherType")
@Excel(name = "凭证类型")
private String voucherType;
/** 凭证状态 **/
@JSONField(name = "voucherStatus")
@Excel(name = "凭证状态" )
private String voucherStatus;
/** 制单时间 **/
@JSONField(name = "preparationTime")
@Excel(name = "制单时间" )
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String preparationTime;
/** 磅单编号 **/
@JSONField(name = "poundCode")
@Excel(name = "磅单编号" )
private String poundCode;
/** 车牌号 **/
@JSONField(name = "vehicleName")
@Excel(name = "车牌号" )
private String vehicleName;
/** 发货单位 **/
@JSONField(name = "supplierName")
@Excel(name = "发货单位" )
private String supplierName;
/** 收货单位 **/
@JSONField(name = "customerName")
@Excel(name = "收货单位" )
private String customerName;
/** 运输方式 **/
@JSONField(name = "modeTransport")
@Excel(name = "运输方式" )
private String modeTransport;
/** 承运方式 **/
@JSONField(name = "transportationMethod")
@Excel(name = "承运方式" )
private String transportationMethod;
/** 承运商 **/
@JSONField(name = "carrier")
@Excel(name = "承运商" )
private String carrier;
/** 起运地 **/
@JSONField(name = "placeDispatch")
@Excel(name = "起运地" )
private String placeDispatch;
/** 到达地 **/
@JSONField(name = "destination")
@Excel(name = "到达地" )
private String destination;
/** 运费 **/
@JSONField(name = "freight")
@Excel(name = "运费" )
private String freight;
/** 关联单据号 **/
@JSONField(name = "associatedDocumentNo")
@Excel(name = "关联单据号" )
private String associatedDocumentNo;
}

@ -752,7 +752,7 @@
</el-table-column>
</el-table>
<div class="table-actions" @click="addcwaccountcontractList()"
v-if="!judgeWrite('cwaccountcontractList') && dataForm.cwaccountcontractList.length == 0">
v-if="!judgeWrite('cwaccountcontractList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
@ -899,467 +899,6 @@
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">凭证信息</span>
</div>
</el-col>
<el-col :span="24" v-if="judgeShow('cwaccountstorage-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.cwaccountvoucherList" size='mini' show-summary
:summary-method="getSummaries1" border>
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="凭证编号" v-if="judgeShow('cwaccountvoucher-voucherCode')"
prop="voucherCode" align="center" width="200" fixed="left">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-voucherCode')">*</span>凭证编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.voucherCode"
@change="changeData('cwaccountvoucher-voucherCode',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="订单序号" v-if="judgeShow('cwaccountvoucher-orderNo')"
prop="orderNo" align="center" width="200">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-orderNo')">*</span>订单序号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.orderNo"
@change="changeData('cwaccountvoucher-orderNo',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="关联业务单号" v-if="judgeShow('cwaccountvoucher-orderId')"
prop="orderId" align="center" width="200">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-orderId')">*</span>关联业务单号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.orderId"
@change="changeData('cwaccountvoucher-orderId',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="单据类型" v-if="judgeShow('cwaccountvoucher-documentType')"
prop="documentType" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-documentType')">*</span>单据类型
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.documentType"
@change="changeData('cwaccountvoucher-documentType',scope.$index)"
placeholder="请选择" :disabled="true" clearable :style='{"width":"100%"}'
:options="cwaccountvoucherdocumentTypeOptions"
:props="cwaccountvoucherdocumentTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="凭证类型" v-if="judgeShow('cwaccountvoucher-voucherType')"
prop="voucherType" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-voucherType')">*</span>凭证类型
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.voucherType"
@change="changeData('cwaccountvoucher-voucherType',scope.$index)"
placeholder="请选择" :disabled="true" clearable :style='{"width":"100%"}'
:options="cwaccountvouchervoucherTypeOptions"
:props="cwaccountvouchervoucherTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="司机名称" prop="driverName" align="center" width="150">
<template slot="header">
<span class="required-sign">*</span>司机名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.driverName" placeholder="请输入" :disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="车牌号" v-if="judgeShow('cwaccountvoucher-vehicleName')"
prop="vehicleName" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-vehicleName')">*</span>车牌号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.vehicleName"
@change="changeData('cwaccountvoucher-vehicleName',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="磅单编号" v-if="judgeShow('cwaccountvoucher-poundCode')"
prop="poundCode" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-poundCode')">*</span>磅单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.poundCode"
@change="changeData('cwaccountvoucher-poundCode',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="磅单时间" v-if="judgeShow('cwaccountvoucher-poundlistTime')"
prop="poundlistTime" align="center" width="200">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-poundlistTime')">*</span>磅单时间
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.poundlistTime"
@change="changeData('cwaccountvoucher-poundlistTime',scope.$index)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" :disabled="true" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="productName" align="center" width="150">
<template slot="header">
<span class="required-sign">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.productName" placeholder="请输入" :disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" v-if="judgeShow('cwaccountvoucher-spec')" prop="spec"
align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-spec')">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('cwaccountvoucher-spec',scope.$index)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="单位" v-if="judgeShow('cwaccountvoucher-unit')" prop="unit"
align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-unit')">*</span>单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.unit"
@change="changeData('cwaccountvoucher-unit',scope.$index)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="毛重" v-if="judgeShow('cwaccountvoucher-grossWeight')"
prop="grossWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-grossWeight')">*</span>毛重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.grossWeight"
@change="changeData('cwaccountvoucher-grossWeight',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="皮重" v-if="judgeShow('cwaccountvoucher-tareWeight')"
prop="tareWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-tareWeight')">*</span>皮重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.tareWeight"
@change="changeData('cwaccountvoucher-tareWeight',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="扣重" v-if="judgeShow('cwaccountvoucher-buckleWeight')"
prop="buckleWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-buckleWeight')">*</span>扣重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.buckleWeight"
@change="changeData('cwaccountvoucher-buckleWeight',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算重量" v-if="judgeShow('cwaccountvoucher-netWeight')"
prop="netWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-netWeight')">*</span>结算重量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.netWeight"
@change="changeData('cwaccountvoucher-netWeight',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="扣杂重量" v-if="judgeShow('cwaccountvoucher-bucklesWeight')"
prop="bucklesWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-bucklesWeight')">*</span>扣杂重量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.bucklesWeight"
@change="bucklesWeightChangeData(scope.row,scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-bucklesWeight')"
:addonAfter="scope.row.unit" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="小计重量" v-if="judgeShow('cwaccountvoucher-subtotalWeight')"
prop="subtotalWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-subtotalWeight')">*</span>小计重量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.subtotalWeight"
@change="changeData('cwaccountvoucher-subtotalWeight',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="合同单价(含税)" v-if="judgeShow('cwaccountvoucher-contractPrice')"
prop="contractPrice" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-contractPrice')">*</span>合同单价含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.contractPrice"
@change="changeData('cwaccountvoucher-contractPrice',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="税率(%)" v-if="judgeShow('cwaccountvoucher-rate')" prop="rate"
align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-rate')">*</span>税率(%)
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.rate"
@change="changeData('cwaccountvoucher-rate',scope.$index)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="合同小计(含税)"
v-if="judgeShow('cwaccountvoucher-contractSubtotal')" prop="contractSubtotal"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-contractSubtotal')">*</span>合同小计含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.contractSubtotal"
@change="changeData('cwaccountvoucher-contractSubtotal',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算单位" v-if="judgeShow('cwaccountvoucher-settlementUnit')"
prop="settlementUnit" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementUnit')">*</span>结算单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementUnit"
@change="changeData('cwaccountvoucher-settlementUnit',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算数量" v-if="judgeShow('cwaccountvoucher-settlementSum')"
prop="settlementSum" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementSum')">*</span>结算数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSum"
@change="settlementSumChangeData(scope.row,scope.$index)" placeholder="请输入"
:addonAfter="scope.row.unit" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算单价(含税)"
v-if="judgeShow('cwaccountvoucher-settlementPrice')" prop="settlementPrice"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementPrice')">*</span>结算单价含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementPrice"
@change="settlementSumChangeData(scope.row,scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-settlementPrice')"
:addonAfter="'/' + scope.row.unit" addonBefore="¥" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算小计(含税)"
v-if="judgeShow('cwaccountvoucher-settlementSubtotal')" prop="settlementSubtotal"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementSubtotal')">*</span>结算小计含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSubtotal"
@change="settlementSubtotalChange(scope.row,scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-settlementSubtotal')"
addonBefore="¥" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算单价(不含税)"
v-if="judgeShow('cwaccountvoucher-settlementPriceNo')" prop="settlementPriceNo"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementPriceNo')">*</span>结算单价不含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementPriceNo"
@change="changeData('cwaccountvoucher-settlementPriceNo',scope.$index)"
placeholder="请输入" :disabled="true" :addonAfter="'/' + scope.row.unit"
addonBefore="¥" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算小计(不含税)"
v-if="judgeShow('cwaccountvoucher-settlementSubtotalNo')"
prop="settlementSubtotalNo" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementSubtotalNo')">*</span>结算小计不含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSubtotalNo"
@change="changeData('cwaccountvoucher-settlementSubtotalNo',scope.$index)"
placeholder="请输入" :disabled="true" addonBefore="¥" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<!-- <el-table-column label="其他费用类型" v-if="judgeShow('cwaccountvoucher-otherType')" prop="otherType" align="center" width="300">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('cwaccountvoucherList-otherType')">*</span>
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.otherType"
@change="otherTypeChange(scope.row,scope.$index)" placeholder="请选择"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-otherType')"
clearable :style='{"width":"40%"}' :options="cwaccountvoucherotherTypeOptions"
:props="cwaccountvoucherotherTypeProps">
</JnpfSelect>
<JnpfInput v-model="scope.row.otherExpenses"
@change="otherTypeChange(scope.row,scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-otherExpenses')"
addonBefore="¥" clearable :style='{"width":"60%"}'>
</JnpfInput>
</template>
</el-table-column> -->
<!-- <el-table-column label="其他费用" v-if="judgeShow('cwaccountvoucher-otherExpenses')" prop="otherExpenses" align="center" width="150">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('cwaccountvoucherList-otherExpenses')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.otherExpenses"
@change="changeData('cwaccountvoucher-otherExpenses',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-otherExpenses')"
addonBefore="¥" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="结算合计(含税)"
v-if="judgeShow('cwaccountvoucher-settlementTotal')" prop="settlementTotal"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementTotal')">*</span>结算合计含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementTotal"
@change="changeData('cwaccountvoucher-settlementTotal',scope.$index)"
placeholder="请输入" addonBefore="¥" :disabled="true" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算合计(不含税)"
v-if="judgeShow('cwaccountvoucher-settlementTotalNo')" prop="settlementTotalNo"
align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-settlementTotalNo')">*</span>结算合计不含税
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementTotalNo"
@change="changeData('cwaccountvoucher-settlementTotalNo',scope.$index)"
placeholder="请输入" addonBefore="¥" :disabled="true" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="备注" v-if="judgeShow('cwaccountvoucher-remark')"
prop="remark" align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-remark')">*</span>备注
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.remark"
@change="changeData('cwaccountvoucher-remark',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('cwaccountvoucherList')||judgeWrite('cwaccountvoucherList-remark')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="50" v-if="!judgeWrite('cwaccountvoucherList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delcwaccountvoucherList(scope.$index)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<div class="table-actions" @click="addcwaccountvoucherList()"
v-if="!judgeWrite('cwaccountvoucherList')">
<el-button type="text" icon="el-icon-plus">加载凭证</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
@ -1369,7 +908,7 @@
<el-col :span="6">
<jnpf-form-tip-item label="汇总类型">
<JnpfSelect v-model="dataForm.summaryType" @change="changeData('summaryType', -1)"
placeholder="请选择" :disabled="judgeWrite('accountSubjectId')"
placeholder="请选择" :disabled="true"
:style='{ "width": "100%" }' :options="summaryTypeOptions"
:props="summaryTypeProps">
</JnpfSelect>
@ -1866,7 +1405,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
summaryType: '1',
summaryType: '2',
subjectId: '',
contractType: '',
type: '1',
@ -2344,6 +1883,7 @@ export default {
const e = list[i];
this.dataForm.cwaccountstorageList.push(e)
}
//this.addcwaccountvoucherList();
},
typeChangeData() {
this.dataForm.cwaccountsubjectList = [];
@ -2359,22 +1899,22 @@ export default {
this.dataForm.businessType = '3'
}
},
contractChangeData(model, row) {
this.dataForm.cwaccountcontractList[0].contractName = row.contract_name
this.dataForm.cwaccountcontractList[0].contractPeriodTime = row.contract_period_time ? row.contract_period_time.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[0].contractPeriodTimeEnd = row.contract_period_time_end ? row.contract_period_time_end.substring(0, 10) : '';
contractChangeData(model, row, rowIndex) {
this.dataForm.cwaccountcontractList[rowIndex].contractName = row.contract_name
this.dataForm.cwaccountcontractList[rowIndex].contractPeriodTime = row.contract_period_time ? row.contract_period_time.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[rowIndex].contractPeriodTimeEnd = row.contract_period_time_end ? row.contract_period_time_end.substring(0, 10) : '';
//this.dataForm.cwaccountcontractList[0].currency = row.currency;
this.dataForm.cwaccountcontractList[0].procurementModel = row.procurement_model;
this.dataForm.cwaccountcontractList[0].pricingModel = row.pricing_model;
this.dataForm.cwaccountcontractList[0].relatedContractId = row.related_contract_id;
this.dataForm.cwaccountcontractList[0].subject = row.subject;
this.dataForm.cwaccountcontractList[0].subject2 = row.subject2;
this.dataForm.cwaccountcontractList[0].deliveryTime = row.delivery_time ? row.delivery_time.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[0].deliveryTimeEnd = row.delivery_time_end ? row.delivery_time_end.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[0].deliveryModel = row.delivery_model;
this.dataForm.cwaccountcontractList[0].deliveryMethod = row.delivery_method;
this.dataForm.cwaccountcontractList[0].modeTransport = row.mode_transport;
this.dataForm.cwaccountcontractList[0].costBearingMian = row.cost_bearing_mian;
this.dataForm.cwaccountcontractList[rowIndex].procurementModel = row.procurement_model;
this.dataForm.cwaccountcontractList[rowIndex].pricingModel = row.pricing_model;
this.dataForm.cwaccountcontractList[rowIndex].relatedContractId = row.related_contract_id;
this.dataForm.cwaccountcontractList[rowIndex].subject = row.subject;
this.dataForm.cwaccountcontractList[rowIndex].subject2 = row.subject2;
this.dataForm.cwaccountcontractList[rowIndex].deliveryTime = row.delivery_time ? row.delivery_time.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[rowIndex].deliveryTimeEnd = row.delivery_time_end ? row.delivery_time_end.substring(0, 10) : '';
this.dataForm.cwaccountcontractList[rowIndex].deliveryModel = row.delivery_model;
this.dataForm.cwaccountcontractList[rowIndex].deliveryMethod = row.delivery_method;
this.dataForm.cwaccountcontractList[rowIndex].modeTransport = row.mode_transport;
this.dataForm.cwaccountcontractList[rowIndex].costBearingMian = row.cost_bearing_mian;
},
subjectChangeData(model, row) {
this.dataForm.subjectId = row.id;
@ -2516,7 +2056,7 @@ export default {
if (!this.cwaccountsubjectExist()) return
if (!this.cwaccountcontractExist()) return
if (!this.cwaccountstorageExist()) return
if (!this.cwaccountvoucherExist()) return
// if (!this.cwaccountvoucherExist()) return
if (!this.cwaccountsummaryExist()) return
return isOk
},
@ -3133,14 +2673,52 @@ export default {
return result
},
addcwaccountsummaryList() {
if (!this.dataForm.cwaccountvoucherList || this.dataForm.cwaccountvoucherList.length == 0) {
if (!this.dataForm.cwaccountstorageList || this.dataForm.cwaccountstorageList.length == 0) {
this.$message({
type: 'error',
message: '请先加载凭证信息',
message: '请先添加对账明细',
duration: 1500,
})
return
}
let storageIdList = [];
let outboundIdList = [];
this.dataForm.cwaccountvoucherList = [];
let storageList = [];
for (let i = 0; i < this.dataForm.cwaccountstorageList.length; i++) {
let storageEntity = {};
storageEntity.storageId = this.dataForm.cwaccountstorageList[i].storageId;
if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '采购入库') {
storageEntity.warehousingStorageType = '采购入库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '退货入库') {
storageEntity.warehousingStorageType = '退货入库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '销售收货单入库') {
storageEntity.warehousingStorageType = '销售收货单入库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '采购收货单入库') {
storageEntity.warehousingStorageType = '采购收货单入库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '销售出库') {
storageEntity.warehousingStorageType = '销售出库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '退供出库') {
storageEntity.warehousingStorageType = '退供出库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '销售发货单出库') {
storageEntity.warehousingStorageType = '销售发货单出库';
} else if (this.dataForm.cwaccountstorageList[i].warehousingStorageType == '采购发货单出库') {
storageEntity.warehousingStorageType = '采购发货单出库';
}
storageList.push(storageEntity);
}
let query = {
warehousingPoundList: storageList
}
request({
url: `/api/scm/WarehousingStorage/getWarehousingstorageoutboundPoundlist`,
method: 'post',
data: query
}).then(res => {
if (res.data) {
this.dataForm.cwaccountsummaryList = res.data
}
})
// var data = JSON.parse(JSON.stringify(this.dataForm.cwaccountstorageList))
// var order = this.dataForm.cwaccountstorageList[0].orderCode
@ -3159,7 +2737,7 @@ export default {
// }
// })
// })
if(this.dataForm.summaryType == 1){
/* if(this.dataForm.summaryType == 1){
this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
this.dataForm.cwaccountsummaryList.forEach(item => {
item.settlementSum = item.settlementSum.toFixed(4);
@ -3188,7 +2766,7 @@ export default {
duration: 1500,
})
return
}
} */
// console.log(this.dataForm.cwaccountsummaryList + "111");

@ -758,7 +758,7 @@
</el-table-column>
</el-table>
<div class="table-actions" @click="addcwsettlementcontractList()"
v-if="!judgeWrite('cwsettlementcontractList') && dataForm.cwsettlementcontractList.length == 0">
v-if="!judgeWrite('cwsettlementcontractList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
@ -2476,8 +2476,12 @@ export default {
for (let i = 0; i < this.dataForm.cwsettlementaccountList.length; i++) {
excludeIdList.push(this.dataForm.cwsettlementaccountList[i].accountId);
}
let contractNameList = [];
for (let i = 0; i < this.dataForm.cwsettlementcontractList.length; i++) {
contractNameList.push(this.dataForm.cwsettlementcontractList[i].contractName);
}
this.$nextTick(() => {
this.$refs.goodsBox.init(excludeIdList, this.dataForm.cwsettlementsubjectList[0].subjectName, this.dataForm.cwsettlementcontractList[0].contractName, '1', this.dataForm.type, this.dataForm.businessType)
this.$refs.goodsBox.init(excludeIdList, this.dataForm.cwsettlementsubjectList[0].subjectName, contractNameList, '1', this.dataForm.type, this.dataForm.businessType)
})
},
choice2() {
@ -2506,22 +2510,22 @@ export default {
this.$refs.goodsBox2.init(excludeIdList, this.dataForm.cwsettlementsubjectList[0].subjectId)
})
},
contractChangeData(model, row) {
this.dataForm.cwsettlementcontractList[0].contractName = row.contract_name
this.dataForm.cwsettlementcontractList[0].contractPeriodTime = row.contract_period_time ? row.contract_period_time.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[0].contractPeriodTimeEnd = row.contract_period_time_end ? row.contract_period_time_end.substring(0, 10) : '';
contractChangeData(model, row, rowIndex) {
this.dataForm.cwsettlementcontractList[rowIndex].contractName = row.contract_name
this.dataForm.cwsettlementcontractList[rowIndex].contractPeriodTime = row.contract_period_time ? row.contract_period_time.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[rowIndex].contractPeriodTimeEnd = row.contract_period_time_end ? row.contract_period_time_end.substring(0, 10) : '';
//this.dataForm.cwsettlementcontractList[0].currency = row.currency;
this.dataForm.cwsettlementcontractList[0].procurementModel = row.procurement_model;
this.dataForm.cwsettlementcontractList[0].pricingModel = row.pricing_model;
this.dataForm.cwsettlementcontractList[0].relatedContractId = row.related_contract_id;
this.dataForm.cwsettlementcontractList[0].subject = row.subject;
this.dataForm.cwsettlementcontractList[0].subject2 = row.subject2;
this.dataForm.cwsettlementcontractList[0].deliveryTime = row.delivery_time ? row.delivery_time.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[0].deliveryTimeEnd = row.delivery_time_end ? row.delivery_time_end.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[0].deliveryModel = row.delivery_model;
this.dataForm.cwsettlementcontractList[0].deliveryMethod = row.delivery_method;
this.dataForm.cwsettlementcontractList[0].modeTransport = row.mode_transport;
this.dataForm.cwsettlementcontractList[0].costBearingMian = row.cost_bearing_mian;
this.dataForm.cwsettlementcontractList[rowIndex].procurementModel = row.procurement_model;
this.dataForm.cwsettlementcontractList[rowIndex].pricingModel = row.pricing_model;
this.dataForm.cwsettlementcontractList[rowIndex].relatedContractId = row.related_contract_id;
this.dataForm.cwsettlementcontractList[rowIndex].subject = row.subject;
this.dataForm.cwsettlementcontractList[rowIndex].subject2 = row.subject2;
this.dataForm.cwsettlementcontractList[rowIndex].deliveryTime = row.delivery_time ? row.delivery_time.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[rowIndex].deliveryTimeEnd = row.delivery_time_end ? row.delivery_time_end.substring(0, 10) : '';
this.dataForm.cwsettlementcontractList[rowIndex].deliveryModel = row.delivery_model;
this.dataForm.cwsettlementcontractList[rowIndex].deliveryMethod = row.delivery_method;
this.dataForm.cwsettlementcontractList[rowIndex].modeTransport = row.mode_transport;
this.dataForm.cwsettlementcontractList[rowIndex].costBearingMian = row.cost_bearing_mian;
},
subjectChangeData(model, row) {
let aaa = {};

@ -45,7 +45,7 @@
{{ scope.row.type}}
</template>
</el-table-column>
<el-table-column prop="contractCode" label="关联合同" align="center" width="200">
<el-table-column prop="contractCodeList" label="关联合同" align="center" width="200">
</el-table-column>
<el-table-column prop="docmentNum" label="关联单据数" align="center" width="150">
</el-table-column>
@ -87,7 +87,7 @@ export default {
},
excludeIdList: [],
accountSubjectName: '',
contractCode: '',
contractCodeListList: '',
accountState: '',
type: '',
businessType: '',
@ -95,7 +95,7 @@ export default {
}
},
methods: {
init(excludeIdList, accountSubjectName, contractCode, accountState, type, businessType) {
init(excludeIdList, accountSubjectName, contractCodeList, accountState, type, businessType) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
@ -104,8 +104,8 @@ export default {
if (accountSubjectName && typeof (accountSubjectName) == 'string') {
this.accountSubjectName = accountSubjectName;
}
if (contractCode && typeof (contractCode) == 'string') {
this.contractCode = contractCode;
if (contractCodeList && contractCodeList instanceof Array) {
this.contractCodeList = contractCodeList;
}
if (accountState && typeof (accountState) == 'string') {
this.accountState = accountState;
@ -121,7 +121,7 @@ export default {
keyword: this.keyword,
excludeIdList: this.excludeIdList,
accountSubjectName: this.accountSubjectName,
contractCode: this.contractCode,
contractCodeList: this.contractCodeList,
accountState: this.accountState,
type: this.type,
businessType: this.businessType,

@ -223,7 +223,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
total: 0,
queryData: {},
listQuery: {
@ -475,7 +475,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
//this.initData()
},
//
async initSearchData() {

@ -669,7 +669,7 @@ export default {
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/Voucher", undefined, undefined, "采购", "退供凭证")
this.$refs.UploadBox.init("", "scm/Voucher", undefined, undefined, "采购", "收货凭证")
})
},
handleSelectionChange(val) {

@ -495,23 +495,26 @@ export default {
})
return
}
if (this.multipleSelectionItem.length > 1) {
this.$message({
type: 'error',
message: '只能选择一条数据',
duration: 1500,
})
return
}
const selectData = this.multipleSelectionItem
if (selectData[0].isTransfer == '2') {
this.$message({
type: 'error',
message: '该订单已经生成过销售订单',
duration: 1500,
})
return
}
const data = this.multipleSelectionItem
let selectData = []
selectData = JSON.parse(JSON.stringify(data))
const firstData = selectData[0]
selectData.forEach((item, index) => {
if (item.saleContractNo !== firstData.saleContractNo) {
this.$message({
type: 'error',
message: '订单' + item.code + '与订单' + firstData.code + '的销售合同号不一致',
duration: 1500,
})
}
if (item.isTransfer == '2') {
this.$message({
type: 'error',
message: '订单' + item.code + '已经生成过销售订单',
duration: 1500,
})
}
})
selectData.flag = '采购转销售'
if (!this.saleFlowList.length) {
this.$message({ type: 'error', message: '流程不存在' });

File diff suppressed because one or more lines are too long

@ -94,7 +94,9 @@
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</el-button>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="createSaleOrder()">生成销售单
</el-button>
@ -898,7 +900,7 @@ export default {
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/Voucher")
this.$refs.UploadBox.init("", "scm/Vehicle")
})
},
handleSelectionChange(val) {

@ -128,7 +128,7 @@
</jnpf-form-tip-item>
</el-col>
</template>
<template v-if="this.productCreate">
<template v-if="this.productCreate && !this.purchaseCreate">
<el-col :span="8" v-if="judgeShow('contractId')">
<jnpf-form-tip-item label="关联合同" v-if="judgeShow('contractId')" prop="contractId">
<el-input v-model="dataForm.contractName" placeholder="请输入" :disabled="true"
@ -139,6 +139,20 @@
</jnpf-form-tip-item>
</el-col>
</template>
<template v-if="this.productCreate && this.purchaseCreate">
<el-col :span="8" v-if="judgeShow('contractId')">
<jnpf-form-tip-item label="关联合同" v-if="judgeShow('contractId')" prop="contractId">
<JnpfPopupSelect v-model="dataForm.contractId" @change="contractInfo"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId"
placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contractName' field='contractId'
interfaceId="531872211288459717" :pageSize="20" :hasPage="true"
:columnOptions="contractIdcolumnOptions" clearable :style='{ "width": "100%" }'
@click.native="relationBusinessLine">
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
</template>
<el-table :data="dataForm.contractInfoList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="合同名称" v-if="judgeShow('businessorderproductrelational-tax')"
@ -1112,6 +1126,7 @@ export default {
ContractBoxVisible: false,
productIds: [],
productCreate: false,
purchaseCreate: false,
isLongAgreement: '',
BomgoodsBoxVisible: false,
BomgoodsBoxVisible1: false,
@ -1192,7 +1207,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
isTransferSource: undefined,
isTransferSource: [],
orderType: "3",
code: undefined,
businessLineId: undefined,
@ -1673,25 +1688,27 @@ export default {
} else if (subjectInfo.overdueInterestRate == 2) {
this.dataForm.settlementInfoList[0].overdueInterestRate = '按月化(' + subjectInfo.applyForOverdueRatio + '%)';
}
if (!this.onlyContract) {
val2.productByContractModelList.forEach(item => {
item.notTaxPrice = this.jnpf.floatDiv(item.businessPrice, this.jnpf.floatAdd(1, this.jnpf.floatDiv(item.tax, 100))).toFixed(6) //
item.notTaxCount = this.jnpf.floatMul(item.businessNum, item.notTaxPrice).toFixed(2) //
item.inventoryUnitId = item.inventoryUnitId1
if (item.saleMainUnitId1) {
var unitName = JSON.parse(item.saleMainUnitId1)
var optArray = [];
for (let i = 0; i < unitName.length; i++) {
item.salesMainUnitId = unitName[0]
var opt = {};
opt.fullName = unitName[i];
opt.id = unitName[i];
optArray.push(opt);
if (!this.purchaseCreate) {
if (!this.onlyContract) {
val2.productByContractModelList.forEach(item => {
item.notTaxPrice = this.jnpf.floatDiv(item.businessPrice, this.jnpf.floatAdd(1, this.jnpf.floatDiv(item.tax, 100))).toFixed(6) //
item.notTaxCount = this.jnpf.floatMul(item.businessNum, item.notTaxPrice).toFixed(2) //
item.inventoryUnitId = item.inventoryUnitId1
if (item.saleMainUnitId1) {
var unitName = JSON.parse(item.saleMainUnitId1)
var optArray = [];
for (let i = 0; i < unitName.length; i++) {
item.salesMainUnitId = unitName[0]
var opt = {};
opt.fullName = unitName[i];
opt.id = unitName[i];
optArray.push(opt);
}
item.businessorderproductrelationalsalesMainUnitIdOptions = optArray;
}
item.businessorderproductrelationalsalesMainUnitIdOptions = optArray;
}
})
this.dataForm.businessOrderProductRelationalList = val2.productByContractModelList
})
this.dataForm.businessOrderProductRelationalList = val2.productByContractModelList
}
}
},
contractInfo2() {
@ -1840,13 +1857,29 @@ export default {
return
}
if (data.flag == '采购转销售') {
this.dataForm.orderType = '1'
this.dataForm.isTransferSource = data[0].id
debugger
this.productCreate = true
this.purchaseCreate = true
this.dataForm.orderType = '3'
this.dataForm.businessLineId = data[0].businessLineId
this.dataForm.counterpartOrderCode = data[0].counterpartOrderCode
this.dataForm.urgentOrder = data[0].urgentOrder
this.dataForm.deliveryType = data[0].deliveryType
this.dataForm.businessOrderProductRelationalList = data[0].businessOrderProductRelationalList
data.forEach((val, index) => {
this.dataForm.isTransferSource.push(val.id)
val.businessOrderProductRelationalList.forEach((item, index) => {
if (this.dataForm.businessOrderProductRelationalList.length == 0) {
this.dataForm.businessOrderProductRelationalList.push(item);
} else {
const product = this.dataForm.businessOrderProductRelationalList.find(net => net.productId == item.productId)
if (product) {
product.businessNum = this.jnpf.floatAdd(product.businessNum, item.businessNum)
} else {
this.dataForm.businessOrderProductRelationalList.push(item)
}
}
})
})
}
if (data.flag == '发货凭证生成销售订单') {
this.productCreate = true

@ -48,7 +48,7 @@
:loading="candidateLoading" :disabled="allBtnDisabled">
{{ properties.submitBtnText || '提 交' }}</el-button>
<el-button type="primary" @click="eventLauncher('audit')" :loading="candidateLoading"
v-if="setting.opType == 1 && properties.hasAuditBtn">{{ properties.auditBtnText || '通 过' }}
v-if="setting.opType == 1 && properties.hasAuditBtn">
</el-button>
<el-button type="primary" @click="press()"
v-if="setting.opType == 0 && setting.status == 1 && (properties.hasPressBtn || properties.hasPressBtn === undefined)">
@ -176,7 +176,7 @@
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="handleApproval()" :loading="approvalBtnLoading">
{{ $t('common.confirmButton') }}
</el-button>
</span>
@ -210,7 +210,7 @@
<span slot="footer" class="dialog-footer">
<el-button @click="resurgenceVisible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="handleResurgence()" :loading="resurgenceBtnLoading">
{{ $t('common.confirmButton') }}
</el-button>
</span>
</el-dialog>

Loading…
Cancel
Save