diff --git a/src/components/RefundCodelist/index.tsx b/src/components/RefundCodelist/index.tsx index fccd8fb..f7f4207 100644 --- a/src/components/RefundCodelist/index.tsx +++ b/src/components/RefundCodelist/index.tsx @@ -42,7 +42,7 @@ const RefundCodelist = (props: Props) => { product_color_code: it.code, product_color_name: it.name, num: it.roll.toString(), - weight: formatWeightDiv(it.label_weight).toString(), + weight: formatWeightDiv(it.actual_weight).toString(), deduction_weight: formatWeightDiv(it.deductions_weight).toString(), settle_weight: formatWeightDiv(it.settle_weight).toString(), deduction_amount: (it.deductions_amount / 100).toString(), @@ -56,40 +56,19 @@ const RefundCodelist = (props: Props) => { const query = { list, title: '售后确认单', - // show_qrcode: true, - // show_barcode: true, - // show_wait_pay_amount: true, order_type: props.obj.sale_mode_name, - // shipment_mode: props.obj.shipment_mode_name, - // company: props.obj.title_purchaser_name, sale_user: props.obj.sale_user_name, order_created_time: formatDateTime(props.obj.create_time), order_no: props.obj.return_order_no, - // target_user_name: props.obj.target_user_name, - // target_address: props.obj.address_detail, - // target_description: props.obj.reason_describe, pay_account: props.obj.transfer_remittance_account, bank_account_name: props.obj.account_name, bank_name: props.obj.bank_of_deposit, - // pay_type: props.obj.settle_mode_name, client: props.obj.purchaser_name, - // phone: props.obj.target_user_phone, order_total_length: (props.obj.total_number / 100).toString(), order_total_price: ( props.obj.refund_amount / 100 ).toString(), - // total_weight_error_discount: ( - // props.obj.total_weight_error_discount / 100 - // ).toString(), order_total_num: props.obj.total_number.toString(), - // qrcode: "", - // order_total_weight: (props.obj.total_weight / 1000).toString(), - // estimate_amount: (props.obj.estimate_amount / 100).toString(), - // total_sale_price: (props.obj.total_sale_price / 100).toString(), - // show_total_sale_price: true, - // show_total_weight_error_discount: true, - // actual_amount: (props.obj.actual_amount / 100).toString(), - // wait_pay_amount: (props.obj.wait_pay_amount / 100).toString(), order_total_settle_weight: ( props.obj.order_total_settle_weight / 1000 ).toString(), @@ -102,6 +81,11 @@ const RefundCodelist = (props: Props) => { order_total_weight_error: ( props.obj.total_weight_error / 1000 ).toString(), + show_sale_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)), + show_total_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)), + show_deduction_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)), + show_order_total_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)), + show_order_total_deduction_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)), } const res = await payFetch(query) if (res.data) { @@ -142,6 +126,7 @@ const RefundCodelist = (props: Props) => { const length = Object.keys(props.obj) if (length.length > 0) { getPic() } }, [props.obj]) + // 保存图片 const saveImage = () => { const time = new Date().valueOf() diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 4249a2e..33ec4a4 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -394,7 +394,6 @@ const Order = () => { title: '面料销售电子确认单', show_qrcode: true, show_barcode: true, - show_wait_pay_amount: true, order_type: itemObj.sale_mode_name, shipment_mode: itemObj.shipment_mode_name, company: itemObj.title_purchaser_name, @@ -422,13 +421,18 @@ const Order = () => { order_total_weight: (itemObj.total_weight / 1000).toString(), estimate_amount: (itemObj.estimate_amount / 100).toString(), total_sale_price: (itemObj.total_sale_price / 100).toString(), - show_total_sale_price: true, - show_total_weight_error_discount: true, actual_amount: (itemObj.actual_amount / 100).toString(), wait_pay_amount: (itemObj.wait_pay_amount / 100).toString(), order_total_weight_error: ( itemObj.total_weight_error / 1000 ).toString(), + show_sale_price: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_total_price: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_estimate_amount: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_total_sale_price: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_total_weight_error_discount: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_actual_amount: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), + show_wait_pay_amount: itemObj?.sale_mode == 0 && itemObj?.is_display_price ? true : !!((itemObj?.sale_mode === 1 || itemObj?.sale_mode === 2)), } const res = await payFetch(query) if (res.data) { diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index 182c32a..6de53c1 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -392,9 +392,9 @@ const OrderDetails = () => { weight: formatWeightDiv(it.actual_weight).toString(), sale_price: (it.sale_price / 100).toString(), total_price: - it.total_sale_price !== 0 - ? (it.total_sale_price / 100).toString() - : (it.estimate_amount / 100).toString(), + it.total_sale_price !== 0 + ? (it.total_sale_price / 100).toString() + : (it.estimate_amount / 100).toString(), length: (it.length / 100).toString(), weight_error: formatWeightDiv(it.weight_error).toString(), }) @@ -405,7 +405,6 @@ const OrderDetails = () => { title: '面料销售电子确认单', show_qrcode: true, show_barcode: true, - show_wait_pay_amount: true, order_type: infoObj.sale_mode_name, shipment_mode: infoObj.shipment_mode_name, company: infoObj.title_purchaser_name, @@ -433,13 +432,18 @@ const OrderDetails = () => { order_total_weight: (infoObj.total_weight / 1000).toString(), estimate_amount: (infoObj.estimate_amount / 100).toString(), total_sale_price: (infoObj.total_sale_price / 100).toString(), - show_total_sale_price: true, - show_total_weight_error_discount: true, actual_amount: (infoObj.actual_amount / 100).toString(), wait_pay_amount: (infoObj.wait_pay_amount / 100).toString(), order_total_weight_error: ( infoObj.total_weight_error / 1000 ).toString(), + show_sale_price: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_total_price: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_estimate_amount: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_total_sale_price: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_total_weight_error_discount: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_actual_amount: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), + show_wait_pay_amount: infoObj?.sale_mode === 0 && infoObj?.is_display_price ? true : !!((infoObj?.sale_mode === 1 || infoObj?.sale_mode === 2)), } const res = await payFetch(query) if (res.data) {