商城测试版v7
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
||||
import { formatHashTag, formatPriceDiv } from "@/common/fotmat";
|
||||
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat";
|
||||
import LabAndImg from "@/components/LabAndImg";
|
||||
import Popup from "@/components/popup";
|
||||
import { ScrollView, Text, View } from "@tarojs/components";
|
||||
@@ -106,7 +106,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
||||
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||
<View className={styles.order_list_item_price}>
|
||||
<Text>¥{standardPrice(colorItem.sale_price)}</Text>
|
||||
<Text>总重{standardPrice(colorItem.estimate_weight)}</Text>
|
||||
<Text>总重{formatWeightDiv(colorItem.estimate_weight)}kg</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.order_list_item_count}>
|
||||
|
||||
@@ -28,6 +28,7 @@ type OrderParam = {
|
||||
quality_check_pass_colors: number, //验布后的颜色总数
|
||||
quality_check_pass_fabrics: number, //验布后的面料数量
|
||||
quality_check_pass_number: number, //验布后的总数量
|
||||
is_quality_check: true|false, //是否质检过
|
||||
}
|
||||
|
||||
type Param = {
|
||||
@@ -36,31 +37,6 @@ type Param = {
|
||||
}
|
||||
|
||||
export default memo(({order, comfirm = false}:Param) => {
|
||||
//对应数量
|
||||
const formatCount = useCallback((item) => {
|
||||
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||
}, [order])
|
||||
//对应单价
|
||||
const standardPrice = useCallback(price => {
|
||||
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||
}, [order])
|
||||
//数量格式
|
||||
const numText = useMemo(() => {
|
||||
if(order) {
|
||||
if(!order?.quality_check_pass_fabrics&&!order?.quality_check_pass_number&&!order?.quality_check_pass_colors) {
|
||||
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
||||
return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||
} else {
|
||||
let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100)
|
||||
return `${order?.quality_check_pass_fabrics} 种面料,${order?.quality_check_pass_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||
}
|
||||
}
|
||||
}, [order])
|
||||
|
||||
//获取面料数组
|
||||
const list = useMemo(() => {
|
||||
return order?.quality_check_pass_product?.length > 0?order?.quality_check_pass_product:order?.product_list
|
||||
}, [order])
|
||||
|
||||
//售后单状态枚举
|
||||
const {
|
||||
@@ -73,15 +49,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
||||
ReturnStageServiceOrderPendingRefund, // 待退款
|
||||
ReturnStageRejected, // 已拒绝
|
||||
} = AFTER_ORDER_STATUS
|
||||
|
||||
//退款状态枚举
|
||||
// const {
|
||||
// ShouldCollectOrderRefundTypeUnknown,
|
||||
// ShouldCollectOrderRefundTypeAdvanceReceiptRefund,
|
||||
// ShouldCollectOrderRefundTypeReturnForRefund,
|
||||
// ShouldCollectOrderRefundTypeSalesRefund,
|
||||
// } = REFUND_STATUS
|
||||
|
||||
|
||||
//金额列表枚举
|
||||
const priceList = [
|
||||
{
|
||||
@@ -133,6 +101,34 @@ export default memo(({order, comfirm = false}:Param) => {
|
||||
)
|
||||
}, [order])
|
||||
|
||||
//对应数量
|
||||
const formatCount = useCallback((item) => {
|
||||
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||
}, [order])
|
||||
|
||||
//对应单价
|
||||
const standardPrice = useCallback(price => {
|
||||
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||
}, [order])
|
||||
|
||||
//数量格式
|
||||
const numText = useMemo(() => {
|
||||
if(order) {
|
||||
if(!order?.is_quality_check) {
|
||||
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
||||
return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||
} else {
|
||||
let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100)
|
||||
return `${order?.quality_check_pass_fabrics} 种面料,${order?.quality_check_pass_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||
}
|
||||
}
|
||||
}, [order])
|
||||
|
||||
//获取面料数组
|
||||
const list = useMemo(() => {
|
||||
return order?.is_quality_check?order?.quality_check_pass_product:order?.product_list
|
||||
}, [order])
|
||||
|
||||
//整理颜色
|
||||
const labAndRgbAndUrl = useCallback((item) => {
|
||||
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
||||
@@ -145,7 +141,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
||||
|
||||
//销售价格
|
||||
const formatPrice = useCallback((colorItem) => {
|
||||
return (ReturnStageReturned.value == order?.stage) && <View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount, {} , true)}</View>
|
||||
return (ReturnStageReturned.value == order?.stage) && <View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount, 100 , true)}</View>
|
||||
}, [order])
|
||||
|
||||
return (
|
||||
|
||||
@@ -46,32 +46,8 @@ import styles from './index.module.scss'
|
||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
||||
const formatData = () => {
|
||||
setFormatDetailOrder({
|
||||
estimate_amount: orderDetail.estimate_amount, //预估金额
|
||||
sale_mode: orderDetail.sale_mode,
|
||||
sale_mode_name: orderDetail.sale_mode_name,
|
||||
total_colors: orderDetail.total_colors, //总颜色数量
|
||||
total_number: orderDetail.total_number, //总数量
|
||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
||||
quality_check_pass_colors: orderDetail.quality_check_pass_colors, //验布后的颜色总数
|
||||
quality_check_pass_fabrics: orderDetail.quality_check_pass_fabrics, //验布后的面料数量
|
||||
quality_check_pass_number: orderDetail.quality_check_pass_number, //验布后的总数量
|
||||
...orderDetail,
|
||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||
// list: orderDetail.quality_check_pass_product.length > 0?orderDetail.quality_check_pass_product:orderDetail.product_list,
|
||||
product_list: orderDetail.product_list,
|
||||
quality_check_pass_product: orderDetail.quality_check_pass_product,
|
||||
stage: orderDetail.stage, //订单状态
|
||||
type: orderDetail.type, //退货or退款
|
||||
total_sale_price: orderDetail.total_sale_price, //销售金额
|
||||
total_should_collect_money: orderDetail.total_should_collect_money, //应收金额
|
||||
total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠
|
||||
actual_amount: orderDetail.actual_amount, //实付金额
|
||||
the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态
|
||||
other_deduction_amount: orderDetail.other_deduction_amount, //其他扣除金额
|
||||
total_refund_amount: orderDetail.total_refund_amount, //合计金额
|
||||
refund_amount: orderDetail.refund_amount, //退款金额
|
||||
refund_type: orderDetail.refund_type, //退款状态
|
||||
refund_flow_name: orderDetail.refund_flow_name //退款去向
|
||||
|
||||
})
|
||||
}
|
||||
const formatPreViewOrderMemo = useMemo(() => {
|
||||
@@ -99,12 +75,7 @@ import styles from './index.module.scss'
|
||||
//按钮所需数据
|
||||
const orderInfo = useMemo(() => {
|
||||
return {
|
||||
stage: orderDetail?.stage, //售后订单状态
|
||||
orderId: orderDetail?.id,
|
||||
settle_mode: orderDetail?.settle_mode,
|
||||
type: orderDetail?.type, //退货or退款
|
||||
sale_mode: orderDetail?.sale_mode, //订单类型
|
||||
return_apply_order_id: orderDetail?.return_apply_order_id
|
||||
...orderDetail
|
||||
}
|
||||
}, [orderDetail])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user