✨ feat(删剪完成):
This commit is contained in:
parent
7f101dabd3
commit
477bb27b91
@ -1,4 +1,4 @@
|
|||||||
import { Input, View } from '@tarojs/components'
|
import { CustomWrapper, Input, View } from '@tarojs/components'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
@ -44,7 +44,9 @@ export default (props: Param) => {
|
|||||||
<View className={styles.popup_modal_title}>{title}</View>
|
<View className={styles.popup_modal_title}>{title}</View>
|
||||||
<View className={styles.popup_modal_input}>
|
<View className={styles.popup_modal_input}>
|
||||||
<View className={styles.input}>
|
<View className={styles.input}>
|
||||||
<Input onInput={onInputEven} value={value} />
|
<CustomWrapper>
|
||||||
|
<Input onInput={onInputEven} value={value} alwaysEmbed cursorSpacing={200} />
|
||||||
|
</CustomWrapper>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.popup_modal_btn}>
|
<View className={styles.popup_modal_btn}>
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
border-radius: 16px 16px 0 0;
|
border-radius: 16px 16px 0 0;
|
||||||
.product_title {
|
.product_title {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
|
@include common_ellipsis();
|
||||||
|
width: 380px;
|
||||||
}
|
}
|
||||||
.mode_status {
|
.mode_status {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
.product_title {
|
.product_title {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
|
@include common_ellipsis();
|
||||||
|
max-width: 380px;
|
||||||
}
|
}
|
||||||
.mode_status {
|
.mode_status {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
|
|||||||
@ -2,11 +2,17 @@
|
|||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding-bottom: 150px;
|
padding-bottom: 150px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
.code_list__head {
|
.code_list__head {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
.loading_card {
|
||||||
|
flex: 1;
|
||||||
|
height: calc(100vh - 300px);
|
||||||
|
}
|
||||||
.code_list_con {
|
.code_list_con {
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { Text, View } from '@tarojs/components'
|
||||||
import { useDidShow, useRouter } from '@tarojs/taro'
|
import { useDidShow, useRouter } from '@tarojs/taro'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState, useTransition } from 'react'
|
||||||
import PayeeHead from '../payeeHead'
|
import PayeeHead from '../payeeHead'
|
||||||
import type { CompanyItem } from '../payeeHead'
|
import type { CompanyItem } from '../payeeHead'
|
||||||
import WholeOrderSetting from '../wholeOrderSetting'
|
import WholeOrderSetting from '../wholeOrderSetting'
|
||||||
@ -14,6 +14,7 @@ import { CreateCustomCodeApi, CustomPrintCalculationApi, GetCustomCodeDetailApi,
|
|||||||
import { formatPriceDiv, formatWeightDiv } from '@/common/fotmat'
|
import { formatPriceDiv, formatWeightDiv } from '@/common/fotmat'
|
||||||
import { useCurrenCode } from '@/context/ContextCodeSetting'
|
import { useCurrenCode } from '@/context/ContextCodeSetting'
|
||||||
import { alert } from '@/common/common'
|
import { alert } from '@/common/common'
|
||||||
|
import LoadingCard from '@/components/loadingCard'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const { productData, dispatch } = useCurrenCode()
|
const { productData, dispatch } = useCurrenCode()
|
||||||
@ -30,17 +31,21 @@ export default () => {
|
|||||||
const modelIndex = useRef(1)
|
const modelIndex = useRef(1)
|
||||||
const getTypeSelect = useCallback((index) => {
|
const getTypeSelect = useCallback((index) => {
|
||||||
modelIndex.current = index
|
modelIndex.current = index
|
||||||
// dispatch({ type: 'changeAdjustType', data: index })
|
|
||||||
getDataInit()
|
getDataInit()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const [codeData, setCodeData] = useState<any>(null)
|
const [codeData, setCodeData] = useState<any>(null)
|
||||||
|
|
||||||
|
const [isPending, startTransition] = useTransition()
|
||||||
|
|
||||||
// 获取新增码单详情
|
// 获取新增码单详情
|
||||||
const { fetchData: getCustomCodeInit } = GetCustomCodeInitApi()
|
const { fetchData: getCustomCodeInit } = GetCustomCodeInitApi()
|
||||||
const onCustomCodeInit = async() => {
|
const onCustomCodeInit = async() => {
|
||||||
const res = await getCustomCodeInit({ id: submit_ids.current.sale_order_id })
|
const res = await getCustomCodeInit({ id: submit_ids.current.sale_order_id })
|
||||||
setCodeData(() => res?.data)
|
setCodeData(() => res?.data)
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取码单编辑详情
|
// 获取码单编辑详情
|
||||||
@ -48,22 +53,29 @@ export default () => {
|
|||||||
const onGetCustomCodeDetail = async() => {
|
const onGetCustomCodeDetail = async() => {
|
||||||
const res = await getCustomCodeDetail({ id: submit_ids.current.custom_print_id })
|
const res = await getCustomCodeDetail({ id: submit_ids.current.custom_print_id })
|
||||||
setCodeData(() => res?.data)
|
setCodeData(() => res?.data)
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDataInit = async() => {
|
const getDataInit = () => {
|
||||||
if (submit_ids.current.custom_print_id) {
|
setLoading(true)
|
||||||
await onGetCustomCodeDetail()
|
startTransition(() => {
|
||||||
}
|
if (submit_ids.current.custom_print_id) {
|
||||||
else {
|
onGetCustomCodeDetail()
|
||||||
await onCustomCodeInit()
|
}
|
||||||
}
|
else {
|
||||||
dispatch({ type: 'changeSaveStatus', data: false })
|
onCustomCodeInit()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDataInit()
|
getDataInit()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const logadingStatus = useMemo(() => {
|
||||||
|
return loading || isPending
|
||||||
|
}, [loading, isPending])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (codeData) {
|
if (codeData) {
|
||||||
codeData && dispatch({
|
codeData && dispatch({
|
||||||
@ -148,47 +160,49 @@ export default () => {
|
|||||||
<PayeeHead defaultValue={company} onSelect={getCompany} />
|
<PayeeHead defaultValue={company} onSelect={getCompany} />
|
||||||
</View>
|
</View>
|
||||||
<SelectList onSelect={getTypeSelect} list={selectList} defaultIndex={1} />
|
<SelectList onSelect={getTypeSelect} list={selectList} defaultIndex={1} />
|
||||||
<View className={styles.code_list_con}>
|
{logadingStatus
|
||||||
<View>
|
? <View className={styles.loading_card}><LoadingCard /></View>
|
||||||
{productData?.adjust_type == 1 && <WholeOrderSetting orderData={productData?.data} />}
|
: <View className={styles.code_list_con}>
|
||||||
</View>
|
<View>
|
||||||
<View>
|
{productData?.adjust_type == 1 && <WholeOrderSetting orderData={productData?.data} />}
|
||||||
{productData?.adjust_type == 2 && <ProductSetting orderData={productData?.data} />}
|
|
||||||
</View>
|
|
||||||
<View>
|
|
||||||
{productData?.adjust_type == 3 && <ColorSetting orderData={productData?.data} />}
|
|
||||||
</View>
|
|
||||||
<View className={styles.code_des}>
|
|
||||||
<View className={styles.code_des_title}>自定义单据信息</View>
|
|
||||||
{codeData?.sale_mode === 0 && <View className={styles.code_des_item}>
|
|
||||||
<Text>合计空差</Text>
|
|
||||||
<Text>{formatWeightDiv(customTotal.total_weight_error)}kg</Text>
|
|
||||||
</View>}
|
|
||||||
<View className={styles.code_des_item}>
|
|
||||||
<Text>合计重量</Text>
|
|
||||||
<Text className={styles.code_des_weight}>{formatWeightDiv(customTotal.total_sale_weight)}kg</Text>
|
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.code_des_item}>
|
<View>
|
||||||
<Text>合计金额</Text>
|
{productData?.adjust_type == 2 && <ProductSetting orderData={productData?.data} />}
|
||||||
<Text className={styles.code_des_price}>¥{formatPriceDiv(customTotal.total_amount)}</Text>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
<View>
|
||||||
<View className={styles.code_des}>
|
{productData?.adjust_type == 3 && <ColorSetting orderData={productData?.data} />}
|
||||||
<View className={styles.code_des_title}>原始单据信息</View>
|
|
||||||
{codeData?.sale_mode === 0 && <View className={styles.code_des_item}>
|
|
||||||
<Text>合计空差</Text>
|
|
||||||
<Text>{formatWeightDiv(productData?.data?.original_total_weight_error)}kg</Text>
|
|
||||||
</View>}
|
|
||||||
<View className={styles.code_des_item}>
|
|
||||||
<Text>合计重量</Text>
|
|
||||||
<Text className={styles.code_des_weight}>{formatWeightDiv(productData?.data?.original_total_sale_weight)}kg</Text>
|
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.code_des_item}>
|
<View className={styles.code_des}>
|
||||||
<Text>合计金额</Text>
|
<View className={styles.code_des_title}>自定义单据信息</View>
|
||||||
<Text className={styles.code_des_price}>¥{formatPriceDiv(productData?.data?.original_total_amount)}</Text>
|
{codeData?.sale_mode === 0 && <View className={styles.code_des_item}>
|
||||||
|
<Text>合计空差</Text>
|
||||||
|
<Text>{formatWeightDiv(customTotal.total_weight_error)}kg</Text>
|
||||||
|
</View>}
|
||||||
|
<View className={styles.code_des_item}>
|
||||||
|
<Text>合计重量</Text>
|
||||||
|
<Text className={styles.code_des_weight}>{formatWeightDiv(customTotal.total_sale_weight)}kg</Text>
|
||||||
|
</View>
|
||||||
|
<View className={styles.code_des_item}>
|
||||||
|
<Text>合计金额</Text>
|
||||||
|
<Text className={styles.code_des_price}>¥{formatPriceDiv(customTotal.total_amount)}</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
<View className={styles.code_des}>
|
||||||
</View>
|
<View className={styles.code_des_title}>原始单据信息</View>
|
||||||
|
{codeData?.sale_mode === 0 && <View className={styles.code_des_item}>
|
||||||
|
<Text>合计空差</Text>
|
||||||
|
<Text>{formatWeightDiv(productData?.data?.original_total_weight_error)}kg</Text>
|
||||||
|
</View>}
|
||||||
|
<View className={styles.code_des_item}>
|
||||||
|
<Text>合计重量</Text>
|
||||||
|
<Text className={styles.code_des_weight}>{formatWeightDiv(productData?.data?.original_total_sale_weight)}kg</Text>
|
||||||
|
</View>
|
||||||
|
<View className={styles.code_des_item}>
|
||||||
|
<Text>合计金额</Text>
|
||||||
|
<Text className={styles.code_des_price}>¥{formatPriceDiv(productData?.data?.original_total_amount)}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>}
|
||||||
<BottomBtn onClick={onBottomClick} />
|
<BottomBtn onClick={onBottomClick} />
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
.product_title {
|
.product_title {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
|
@include common_ellipsis();
|
||||||
|
max-width: 380px;
|
||||||
}
|
}
|
||||||
.mode_status {
|
.mode_status {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
|
|||||||
@ -80,7 +80,6 @@ const Index = memo((props: IndexParam) => {
|
|||||||
const [showEdit, setShowEdit] = useState(false)
|
const [showEdit, setShowEdit] = useState(false)
|
||||||
const [upStatus, setStatus] = useState(false)
|
const [upStatus, setStatus] = useState(false)
|
||||||
const [title, setTitle] = useState('')
|
const [title, setTitle] = useState('')
|
||||||
console.log('productInfo内容:::', productInfo)
|
|
||||||
const onUpdate = () => {
|
const onUpdate = () => {
|
||||||
setTitle(productInfo.product_name)
|
setTitle(productInfo.product_name)
|
||||||
setShowEdit(true)
|
setShowEdit(true)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { View } from '@tarojs/components'
|
import { CustomWrapper, View } from '@tarojs/components'
|
||||||
import { useContext, useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import Counter from '../counter'
|
import Counter from '../counter'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
@ -42,15 +42,21 @@ export default (props: Props) => {
|
|||||||
return <View className={styles.change_count}>
|
return <View className={styles.change_count}>
|
||||||
<View className={styles.change_count__item}>
|
<View className={styles.change_count__item}>
|
||||||
<View className={styles['change_count__item--title']}>重量</View>
|
<View className={styles['change_count__item--title']}>重量</View>
|
||||||
<Counter defaultNum={defaultNum.weight} minNum={-1000} digits={2} onChange={num => getNumber(num, 'weight')} onBlue={num => getNumber(num, 'weight')} />
|
<CustomWrapper>
|
||||||
|
<Counter defaultNum={defaultNum.weight} minNum={-1000} digits={2} onChange={num => getNumber(num, 'weight')} onBlue={num => getNumber(num, 'weight')} />
|
||||||
|
</CustomWrapper>
|
||||||
</View>
|
</View>
|
||||||
{sale_mode === 0 && <View className={styles.change_count__item}>
|
{sale_mode === 0 && <View className={styles.change_count__item}>
|
||||||
<View className={styles['change_count__item--title']}>空差</View>
|
<View className={styles['change_count__item--title']}>空差</View>
|
||||||
<Counter defaultNum={defaultNum.weight_error} minNum={-1000} digits={2} onChange={num => getNumber(num, 'weight_error')} onBlue={num => getNumber(num, 'weight_error')} />
|
<CustomWrapper>
|
||||||
|
<Counter defaultNum={defaultNum.weight_error} minNum={-1000} digits={2} onChange={num => getNumber(num, 'weight_error')} onBlue={num => getNumber(num, 'weight_error')} />
|
||||||
|
</CustomWrapper>
|
||||||
</View>}
|
</View>}
|
||||||
<View className={styles.change_count__item}>
|
<View className={styles.change_count__item}>
|
||||||
<View className={styles['change_count__item--title']}>单价</View>
|
<View className={styles['change_count__item--title']}>单价</View>
|
||||||
<Counter defaultNum={defaultNum.sale_price} minNum={-1000} digits={2} onChange={num => getNumber(num, 'sale_price')} onBlue={num => getNumber(num, 'sale_price')} />
|
<CustomWrapper>
|
||||||
|
<Counter defaultNum={defaultNum.sale_price} minNum={-1000} digits={2} onChange={num => getNumber(num, 'sale_price')} onBlue={num => getNumber(num, 'sale_price')} />
|
||||||
|
</CustomWrapper>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ export default memo((props: Parma) => {
|
|||||||
}, [productList])
|
}, [productList])
|
||||||
|
|
||||||
const defaultNum = useMemo(() => {
|
const defaultNum = useMemo(() => {
|
||||||
console.log('orderData::默认', orderData)
|
console.log('orderData::默认', productData)
|
||||||
return {
|
return {
|
||||||
weight: Big(orderData?.weight_admin || 0).div(Big(1000)).toNumber(),
|
weight: Big(orderData?.weight_admin || 0).div(Big(1000)).toNumber(),
|
||||||
sale_price: Big(orderData?.price_admin || 0).div(Big(100)).toNumber(),
|
sale_price: Big(orderData?.price_admin || 0).div(Big(100)).toNumber(),
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
.product_title {
|
.product_title {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
|
@include common_ellipsis();
|
||||||
|
max-width: 380px;
|
||||||
}
|
}
|
||||||
.mode_status {
|
.mode_status {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
@ -24,6 +26,7 @@
|
|||||||
.product_list__item--con {
|
.product_list__item--con {
|
||||||
transition: height 0.3s ease-in-out;
|
transition: height 0.3s ease-in-out;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
max-height: 5000px;
|
||||||
}
|
}
|
||||||
.open_up_icon {
|
.open_up_icon {
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { CustomWrapper, Text, View } from '@tarojs/components'
|
||||||
import { memo, useCallback, useContext, useState } from 'react'
|
import { memo, useCallback, useContext, useState } from 'react'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import ProductItem from '../../productItem'
|
import ProductItem from '../../productItem'
|
||||||
@ -58,5 +58,6 @@ const Index = memo((props: IndexParam) => {
|
|||||||
<View className={styles.up_btn} onClick={() => setStatus(!upStatus)}>{upStatus ? '查看更多' : '收起'}<View className={classNames(styles.up_icon, upStatus ? styles.open_up_icon : styles.close_up_icon)}><IconFont name="icon-shangla" size={35} /></View></View>
|
<View className={styles.up_btn} onClick={() => setStatus(!upStatus)}>{upStatus ? '查看更多' : '收起'}<View className={classNames(styles.up_icon, upStatus ? styles.open_up_icon : styles.close_up_icon)}><IconFont name="icon-shangla" size={35} /></View></View>
|
||||||
</View>
|
</View>
|
||||||
<PopupModal show={showEdit} title="修改面料名称" defaultValue={title} onClose={() => setShowEdit(false)} onConfirm={onConfirm} />
|
<PopupModal show={showEdit} title="修改面料名称" defaultValue={title} onClose={() => setShowEdit(false)} onConfirm={onConfirm} />
|
||||||
|
|
||||||
</>
|
</>
|
||||||
})
|
})
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export interface CodeParam {
|
|||||||
custom_print_id: number // 自定义码单id
|
custom_print_id: number // 自定义码单id
|
||||||
sale_order_id: number // 销售码单id
|
sale_order_id: number // 销售码单id
|
||||||
admin_data: adminParam|null // 需要传给后端的数据
|
admin_data: adminParam|null // 需要传给后端的数据
|
||||||
save_status: boolean // 是否保存了数据
|
|
||||||
color_item_data: any // 当前编辑的颜色数据
|
color_item_data: any // 当前编辑的颜色数据
|
||||||
update_status: 0|1|2
|
update_status: 0|1|2
|
||||||
purchaser_form_title: CompanyItem // 码单抬头
|
purchaser_form_title: CompanyItem // 码单抬头
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user