Commit 13d44158 authored by GuanHua's avatar GuanHua

feat:修改渠道添加进货单参数

parent 212fdaac
......@@ -14,7 +14,7 @@ import { store } from '@/store'
import ProductDescription from './components/ProductDescription'
import InputNumber from '@/components/InputNumber'
import { PublicApi } from '@/services/api'
import { GetSearchShopStoreGetCommodityDetailResponse } from '@/services/SearchApi'
import { GetSearchShopStoreGetCommodityDetailResponse, GetSearchShopChannelGetCommodityDetailResponse } from '@/services/SearchApi'
import { getAuth } from '@/utils/auth'
import { numFormat, priceFormat } from '@/utils/numberFomat'
import jinhuodanIcon from '@/assets/imgs/jinhuodan.png'
......@@ -62,7 +62,7 @@ const CommodityDetail = (props) => {
const { updateOrderInfo } = OrderStore
const [addSuccessVisible, setAddSuccessVisible] = useState<boolean>(false)
const [attributeList, setAttributeList] = useState([])
const [commodityDetail, setCommodityDetail] = useState<GetSearchShopStoreGetCommodityDetailResponse>()
const [commodityDetail, setCommodityDetail] = useState<GetSearchShopStoreGetCommodityDetailResponse & GetSearchShopChannelGetCommodityDetailResponse>()
const [attrAndValList, setAttrAndValList] = useState<any>({})
const [selectAttrVal, setSelectAttrVal] = useState<selectAttrValType[]>([])
const [stockCount, setStockCount] = useState<number>(0)
......@@ -70,6 +70,7 @@ const CommodityDetail = (props) => {
const [commodityPriceInfo, setCommodityPriceInfo] = useState([])
const [parameter, setParameter] = useState<number>() // 权益参数
const [selectCommodityId, setSelectCommodityId] = useState<number>()
const [selectCommodityUnitPriceId, setSelectCommodityUnitPriceId] = useState<number>()
const [buyCount, setBuyCount] = useState<number>(1)
const [purchaseCount, setPurchaseCount] = useState<number>(0)
const [payWayList, setPayWayList] = useState([])
......@@ -284,6 +285,7 @@ const CommodityDetail = (props) => {
} else {
if (selectCommodityId) {
setSelectCommodityId(null)
setSelectCommodityUnitPriceId(null)
}
}
......@@ -301,7 +303,7 @@ const CommodityDetail = (props) => {
})
if (judgeArrisCommon(temp, selectAttrVal)) {
setSelectCommodityId(item.id)
setSelectCommodityUnitPriceId(item.commodityUnitPriceAndPicId)
setCurrentPriceRange(sortUnitPrice(item.unitPrice))
setAttrAndValList(item)
setStockCount(item.stockCount)
......@@ -346,6 +348,8 @@ const CommodityDetail = (props) => {
case LAYOUT_TYPE.channel:
case LAYOUT_TYPE.ichannel:
param.commodityType = 2
param.channelCommodityUnitPriceId = selectCommodityId
param.commodityUnitPriceId = selectCommodityUnitPriceId
postFn = PublicApi.postSearchShopPurchaseChannelSaveOrUpdatePurchase
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment