Commit 436b13df authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev

parents f77c3000 680e09e8
......@@ -23,16 +23,9 @@ export default [
},
// 待新建需求单 - 列表
{
path: '/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList',
path: '/memberCenter/tranactionAbility/enquirySubmit/addDemandOrder',
name: 'toAddSubmitList',
component: '@/pages/transaction/enquirySubmit/toAddSubmit'
},
// 待新增需求单-新增
{
path: '/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList/add',
name: 'addEnquiry',
component: '@/pages/transaction/enquirySubmit/toAddSubmit/detail',
hideInMenu: true,
component: '@/pages/transaction/enquirySubmit/addDemandOrder'
},
// 待新增需求单-新增
{
......@@ -48,13 +41,6 @@ export default [
component: '@/pages/transaction/enquirySubmit/addDemandOrder/addForm',
hideInMenu: true,
},
// 待新增需求单-编辑
{
path: '/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList/edit',
name: 'editEnquiry',
component: '@/pages/transaction/enquirySubmit/toAddSubmit/detail',
hideInMenu: true,
},
// 待新建需求单 - 查看需求单号
{
path: '/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList/preview',
......
......@@ -294,10 +294,10 @@ export const ORDER_TYPE = ['',
'需求采购',
'现货采购',
'集采',
'积分兑换',
'渠道直采',
'渠道现货',
'渠道积分兑换',
'积分兑换',
'渠道积分兑换'
]
// 提货方式
......
......@@ -718,7 +718,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
valuePropName="checked"
>
<Checkbox>允许使用会员折扣价购买</Checkbox>
<Checkbox disabled={planPrice === 3}>允许使用会员折扣价购买</Checkbox>
</Form.Item>
</Form>
{/* 批量设置按钮 */}
......
......@@ -62,13 +62,14 @@ const DirectChannel: React.FC<{}> = () => {
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 60
},
{
title: '商品名称',
dataIndex: ['channelCommodity', 'commodity', 'name'],
key: 'id',
className: 'commonPickColor',
width: 300,
width: 240,
ellipsis: true,
render: (text:any, record:any) => <EyePreview
url={`/memberCenter/commodityAbility/commodity/products/directChannel/detail?id=${record.id}`}
......@@ -77,12 +78,12 @@ const DirectChannel: React.FC<{}> = () => {
</EyePreview>
},
{
title: '品类',
title: '商品品类',
dataIndex: ['channelCommodity', 'commodity', 'customerCategory', 'name'],
key: 'id',
},
{
title: '品牌',
title: '商品品牌',
dataIndex: ['channelCommodity', 'commodity', 'brand', 'name'],
key: 'id',
},
......@@ -151,7 +152,7 @@ const DirectChannel: React.FC<{}> = () => {
render: (text, record) => moment(text).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '状态',
title: '商品状态',
dataIndex: 'status',
key: 'id',
render: (text:any, record:any) => {
......
......@@ -68,23 +68,24 @@ const Products: React.FC<{}> = () => {
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 60
},
{
title: '商品名称',
dataIndex: 'name',
key: 'name',
className: 'commonPickColor',
width: 300,
width: 240,
ellipsis: true,
render: (text: any, record: any) => <a title={text} onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></a>
},
{
title: '品类',
title: '商品品类',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory.name',
},
{
title: '品牌',
title: '商品品牌',
dataIndex: ['brand', 'name'],
key: 'brand.name',
},
......@@ -149,7 +150,7 @@ const Products: React.FC<{}> = () => {
render: (text:any, record:any)=>text && moment(text).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '审核状态',
title: '商品状态',
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => {
......@@ -199,6 +200,7 @@ const Products: React.FC<{}> = () => {
{
title: '操作',
dataIndex: 'option',
width: 160,
render: (text: any, record: any) => renderOptionButton(record)
}
];
......
......@@ -124,27 +124,27 @@ export const channelSchema: ISchema = {
// style: { width: '174px' },
},
},
priceTypeList: {
type: 'string',
enum: [
{
label: '现货价格',
value: 1,
},
// {
// label: '价格需要询价',
// value: 2,
// },
{
label: '积分兑换商品',
value: 3,
}
],
'x-component-props': {
placeholder: '产品定价',
// style: { width: '174px' },
},
},
// priceTypeList: {
// type: 'string',
// enum: [
// {
// label: '现货价格',
// value: 1,
// },
// // {
// // label: '价格需要询价',
// // value: 2,
// // },
// {
// label: '积分兑换商品',
// value: 3,
// }
// ],
// 'x-component-props': {
// placeholder: '产品定价',
// // style: { width: '174px' },
// },
// },
'NO_NAME_FIELD_$2': {
type: 'object',
'x-component': 'layout',
......
......@@ -33,7 +33,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [form] = Form.useForm()
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [operationType, setOprationType] = useState<string>(OPERATION_TYPE.list) // 操作类型:list:显示已选列表;select:选择列表
let [isHighSearch, setIsHighSearch] = useState(false)
const [isHighSearch, setIsHighSearch] = useState(false)
const { templateid, categoryid, goodsList = [], templateType } = props
const [current, setCurrent] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(10)
......@@ -49,33 +49,27 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [noSelectBrands, setNoSelectBrands] = useState<any[]>([])
const changeNewProps = (key: string, data: any) => {
const newProps = { ...props }
newProps[key] = data
setNewProps(newProps)
}
useEffect(() => {
fetchBrandsList()
fetchCategoryList()
}, [])
const fetchCategoryList = () => {
let param = {
const param: any = {
categoryId: categoryid,
templateId: templateid
}
setSpinLoading(true)
//@ts-ignore
PublicApi.getTemplatePlatformFindCategoryList(param).then(res => {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
setSpinLoading(false)
if (res.code === 1000) {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
}
})
}
const fetchBrandsList = () => {
let param = {
const param: any = {
type: 0,
templateId: templateid,
categoryId: categoryid,
......@@ -83,7 +77,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
pageSize: 100
}
//@ts-ignore
PublicApi.getTemplatePlatformFindBrandList(param).then((res: any) => {
if (res.code === 1000) {
const dataInfo = res.data
......@@ -98,7 +91,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}, [filterParam, current])
const fetchGoodsList = () => {
let param = {
let param: any = {
type: 0,
templateId: templateid,
categoryId: categoryid,
......@@ -115,13 +108,14 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
getFn = PublicApi.getTemplateShopFindGoodsList
}
//@ts-ignore
setSpinLoading(true)
getFn(param).then((res: any) => {
if (res.code === 1000) {
const dataInfo = res.data
setTotalCount(dataInfo.totalCount)
setNoSelectGoods(dataInfo.data || [])
}
setSpinLoading(false)
})
}
......@@ -154,7 +148,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handleSearch = () => {
setCurrent(1)
let param = filterProps(form.getFieldsValue())
const param = filterProps(form.getFieldsValue())
setFilterParam(param)
}
......@@ -194,7 +188,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
// if (selectGoodsList.length <= 0) {
// message.error("请选择要推荐的商品")
// return
// } else
// } else
if (selectGoodsList.length > 10) {
message.error("最多只能推荐10件商品")
return
......@@ -228,13 +222,13 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const saveGoods = () => {
return new Promise((resolve, reject) => {
let param: any = {
const param: any = {
templateId: templateid,
categoryId: categoryid,
}
let ids: number[] = []
const ids: number[] = []
for (let item of selectGoodsList) {
for (const item of selectGoodsList) {
ids.push(item.goodsId)
}
param.goodsIds = ids
......@@ -258,8 +252,8 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handleChangeOprationType = (type: string) => {
setOprationType(type)
let keys: number[] = []
for (let item of selectGoodsList) {
const keys: number[] = []
for (const item of selectGoodsList) {
keys.push(item.goodsId)
}
setGoodsIds(keys)
......@@ -314,7 +308,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
</Col>
<Col>
<Button onClick={() => setIsHighSearch(isHighSearch = !isHighSearch)}>高级筛选{isHighSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}</Button>
<Button onClick={() => setIsHighSearch(!isHighSearch)}>高级筛选{isHighSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}</Button>
</Col>
<Col>
<Button onClick={() => handleReset()}>重置</Button>
......@@ -336,7 +330,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
>
<Select placeholder="品类" style={{ width: 180 }}>
{
categoryResponseList.map((item, index) => <Select.Option kye={`select_category_item_${index}`} value={item.categoryId}>{item.categoryName}</Select.Option>)
categoryResponseList.map((item, index) => <Select.Option key={`select_category_item_${index}`} value={item.categoryId}>{item.categoryName}</Select.Option>)
}
</Select>
</Form.Item>
......@@ -348,7 +342,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
>
<Select placeholder="品牌" style={{ width: 180 }}>
{
noSelectBrands.map((item, index) => (<Select.Option kye={`select_brand_item_${index}`} value={item.brandId}>{item.brandName}</Select.Option>))
noSelectBrands.map((item, index) => (<Select.Option key={`select_brand_item_${index}`} value={item.brandId}>{item.brandName}</Select.Option>))
}
</Select>
</Form.Item>
......
......@@ -501,7 +501,8 @@ const CommodityDetail = (props) => {
stockCount: stockCount,
minOrder: commodityDetail.minOrder,
commodityPic: attrAndValList.commodityPic ? attrAndValList.commodityPic[0] : commodityDetail.mainPic,
attribute: attrAndValList.attributeAndValueList
attribute: attrAndValList.attributeAndValueList,
isMemberPrice: commodityDetail.isMemberPrice ? 1 : 0
}
const sessionKey = `${commodityDetail.id}${new Date().getTime()}`
......
......@@ -34,9 +34,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
setLastCategoryId(null)
setSelectAttrbuteList([])
} else {
let initKeys = []
const initKeys = []
// let initAttrKeys = []
for (let item of filterList) {
for (const item of filterList) {
if (item.type === FILTER_TYPE.category) {
initKeys.push(String(item.key))
}
......@@ -50,7 +50,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
useEffect(() => {
let getCategoryListFn
let param: any = {}
const param: any = {}
let headers = {}
/**
* 根据不通过的页面类型,请求不同的品类接口
......@@ -105,7 +105,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
useEffect(() => {
if (lastCategoryId) {
let param: any = {
const param: any = {
categoryId: lastCategoryId
}
let getAttributeFn
......@@ -160,8 +160,8 @@ const Category: React.FC<CategoryPropsType> = (props) => {
if (!list) {
return []
}
let initExpandKeys = []
let result: any = list.map(item => {
const initExpandKeys = []
const result: any = list.map(item => {
initExpandKeys.push(item.id)
return {
title: item.title,
......@@ -200,7 +200,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
setAttributeList([])
onFilter({
type: FILTER_TYPE.attribute,
key: [],
key: null,
title: ``
})
}
......@@ -217,12 +217,12 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const getDetailById = (attrId, attrValId, state = 2) => {
let detail = {}
for (let item of attributeList) {
for (const item of attributeList) {
if (item.id === attrId) {
if (state === 1) {
detail = item
} else {
for (let childItem of item.attributeValueList) {
for (const childItem of item.attributeValueList) {
if (childItem.value === attrValId) {
detail = childItem
}
......@@ -235,7 +235,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const getSelectAttributeList = (selectList) => {
let ids = []
for (let item of selectList) {
for (const item of selectList) {
ids = [...ids, ...item.customerAttributeValueList.map(childItem => childItem.id)]
}
return ids
......@@ -243,12 +243,12 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const handleChange = (attrId, checkedList) => {
let tempSelect = [...initSelectAttributeList]
let attrInfo: any = getDetailById(attrId, attrId, 1)
let tempItem = {
const attrInfo: any = getDetailById(attrId, attrId, 1)
const tempItem = {
customerAttributeId: attrId,
customerAttributeName: attrInfo.name,
customerAttributeValueList: checkedList.map(item => {
let detail: any = getDetailById(attrId, item)
const detail: any = getDetailById(attrId, item)
return {
id: detail.value,
name: detail.label
......@@ -268,7 +268,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
tempSelect.push(tempItem)
}
let keys = getSelectAttributeList(tempSelect)
const keys = getSelectAttributeList(tempSelect)
setSelectAttrbuteList(keys)
tempSelect = tempSelect.filter(item => item.customerAttributeValueList.length > 0)
onFilter({
......
......@@ -27,8 +27,8 @@ const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
if (isEmpty(filterList)) {
setSelectKeys([])
} else {
let initKeys = []
for (let item of filterList) {
const initKeys = []
for (const item of filterList) {
if (item.type === FILTER_TYPE.commodityType) {
initKeys.push(Number(item.key))
}
......@@ -54,7 +54,7 @@ const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
} else {
onFilter({
type: FILTER_TYPE.commodityType,
key: [],
key: false,
title: ''
})
}
......@@ -62,7 +62,7 @@ const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
const getItemText = (key: number) => {
let result = ""
for (let item of styleOptions) {
for (const item of styleOptions) {
if (item.value === key) {
result = item.label
}
......
......@@ -73,11 +73,11 @@ const Order: React.FC<OrderPropsType> = (props) => {
}, [])
const initOrderInfo = async () => {
let result = []
const result = []
const sessionOrderInfo: any = await getOrderInfo(spam_id)
for (let item of sessionOrderInfo.orderList) {
let tempOrderList = []
for (let orderItem of item.orderList) {
for (const item of sessionOrderInfo.orderList) {
const tempOrderList = []
for (const orderItem of item.orderList) {
let resData: any = {}
if (orderItem.logistics?.sendAddress) {
try {
......@@ -103,17 +103,17 @@ const Order: React.FC<OrderPropsType> = (props) => {
// 是否选用电子合同
if (data.isElectronicContract) {
setElectronicContractId(data.electronicContractId)
if (!!sessionStorage.getItem(`contract${spam_id}`)) {
if (sessionStorage.getItem(`contract${spam_id}`)) {
setContractInfo(JSON.parse(sessionStorage.getItem(`contract${spam_id}`)))
setIsElectronicContract(true)
} else {
// 根据电子合同模板id获取生成电子合同
let param = {
const param: any = {
contractTemplateId: data.electronicContractId,
signMemberId: userInfo?.memberId,
orderNo: new Date().getTime()
}
//@ts-ignore
const signRes = await PublicApi.postOrderSignatureSignContractCreate(param)
const signData: any = signRes.data
if (signRes.code === 1000) {
......@@ -173,8 +173,8 @@ const Order: React.FC<OrderPropsType> = (props) => {
const getCommodityAmount = () => {
let amount = 0
for (let item of orderInfo.orderList) {
for (let orderItem of item.orderList) {
for (const item of orderInfo.orderList) {
for (const orderItem of item.orderList) {
amount += (orderItem.unitPrice * orderItem.count)
}
}
......@@ -187,10 +187,10 @@ const Order: React.FC<OrderPropsType> = (props) => {
const getLogisticsFeeAnync = async () => {
if (selectAddressInfo) {
let orderProductList = []
for (let item of orderInfo.orderList) {
for (let orderItem of item.orderList) {
let templateId = orderItem.logistics?.templateId
const orderProductList = []
for (const item of orderInfo.orderList) {
for (const orderItem of item.orderList) {
const templateId = orderItem.logistics?.templateId
// 判断是否物流的方式和由买家承担费用并使用了运费模板
if (orderItem.logistics?.deliveryType === 1 && orderItem.logistics?.carriageType === 2 && orderItem.logistics?.useTemplate && templateId) {
orderProductList.push({
......@@ -202,7 +202,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
}
if (orderProductList.length > 0) {
let params: any = {
const params: any = {
orderProductList,
receiverAddressId: selectAddressInfo.id
}
......@@ -210,7 +210,9 @@ const Order: React.FC<OrderPropsType> = (props) => {
const res: any = await PublicApi.postLogisticsFreightTemplateCalFreightPrice(params)
message.destroy()
setLogisticsFee(Number(res.data))
} catch (error) { }
} catch (error) {
console.log(error)
}
}
}
}
......@@ -261,7 +263,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
* 提交订单
*/
const submitOrder = (signatureLogId?: number) => {
let params: any = {
const params: any = {
orderModel: getOrderMode(), // 下单模式
needTheInvoice: needTheInvoice ? 1 : 0,
}
......@@ -278,12 +280,12 @@ const Order: React.FC<OrderPropsType> = (props) => {
// params.addres = selectAddressInfo.address
}
let orderProductRequests = []
let purchaseIds = []
for (let item of orderList) {
const orderProductRequests = []
const purchaseIds = []
for (const item of orderList) {
for (let orderItem of item.orderList) {
let temp: any = {}
for (const orderItem of item.orderList) {
const temp: any = {}
purchaseIds.push(orderItem.purchaseId)
temp.imgUrl = orderItem.commodityPic
temp.productId = orderItem.id
......@@ -299,6 +301,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
temp.minOrder = orderItem.minOrder
temp.memberId = orderInfo.supplyMembersId
temp.memberRoleId = orderInfo.supplyMembersRoleId
temp.isMemberPrice = orderItem.isMemberPrice
orderProductRequests.push(temp)
}
}
......@@ -316,7 +319,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
params.theInvoiceId = selectInvoiceInfo.id
params.theInvoiceInfo = selectInvoiceInfo
}
if (!!orderInfo.purchaseOrder) {
if (orderInfo.purchaseOrder) {
params.idList = purchaseIds
params.productType = (layoutType === LAYOUT_TYPE.channel || layoutType === LAYOUT_TYPE.ichannel) ? 2 : 1
}
......@@ -388,13 +391,13 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
const handleSignModalConfirm = () => {
let param = {
const param: any = {
contractTemplateId: electronicContractId,
contractName: contractInfo.contractName,
contractUrl: contractInfo.contractUrl,
}
setAgreeSignLoading(true)
// @ts-ignore
PublicApi.postOrderSignatureOrderSettleSign(param).then((res: any) => {
if (res.code === 1000) {
message.destroy()
......@@ -409,7 +412,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
const pollingCheckStatus = (signatureLogId) => {
let param = {
const param = {
signatureLogId
}
PublicApi.getOrderSignatureOrderSettleSignDetail(param).then(res => {
......
......@@ -89,8 +89,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 初始化进货单数据
* @param list
* @param initState
* @param list
* @param initState
*/
const initPurchaseList = async (list: GetSearchShopPurchaseGetPurchaseListResponse) => {
let result = []
......@@ -119,7 +119,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
price: isMemberPrice ? Number(unitPrice[key]) * Number(parameter) : unitPrice[key]
})
})
item.commodityUnitPrice['priceRange'] = tempPriceRange
tempItem.orderList = [...tempItem.orderList, item]
tempResult.push(tempItem)
......@@ -234,8 +234,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 修改购买数量
* @param count
* @param id
* @param count
* @param id
*/
const handleCountChange = (count: number, id: number, type: string) => {
handleChangeFinishCount(count, id)
......@@ -273,8 +273,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 修改商品购买数量
* @param count
* @param id
* @param count
* @param id
*/
const handleChangeFinishCount = (count, id) => {
const result = orderList.map(item => {
......@@ -291,8 +291,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 计算单个商品总价格
* @param priceRange
* @param count
* @param priceRange
* @param count
*/
const computeItemPrice = (priceRange, count) => {
count = Number(count)
......@@ -314,7 +314,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 删除进货单的商品
* @param id
* @param id
*/
const handleDeleteItem = (id: number) => {
Modal.confirm({
......@@ -387,7 +387,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 删除指定id的商品
* @param ids
* @param ids
*/
const deleteListItems = (ids: number[]) => {
const newOrderList = JSON.parse(JSON.stringify(orderList))
......@@ -436,8 +436,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 获取用户权益参数
* @param memberId
* @param memberRoleId
* @param memberId
* @param memberRoleId
*/
const getMemberCredit = (memberId, memberRoleId) => {
return new Promise((resolve) => {
......@@ -455,10 +455,10 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 获取支付方式
* @param memberId
* @param memberId
*/
const getPayWayListByMemberId = (memberId: number) => {
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
if (!memberId) {
resolve([])
return
......@@ -469,6 +469,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
PublicApi.getPayPayWayList(param).then(res => {
if (res.code === 1000) {
resolve(initPayWayList(res.data))
} else {
resolve([])
}
})
})
......@@ -539,7 +541,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
purchaseIds.push(item.id)
productIds.push(item.commodityUnitPrice.id)
commonLogistics = item.commodityUnitPrice.commodity.logistics
if(item.commodityUnitPrice.commodity.logistics.deliveryType === 1) {
hasLogistics = true
logisticsInfo = item.commodityUnitPrice.commodity.logistics
......@@ -558,7 +560,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
brand: item.commodityUnitPrice.commodity.brand.name,
commodityPic: item.commodityUnitPrice.commodity.mainPic,
attribute: item.commodityUnitPrice.attributeAndValueList,
stockCount: item.stockCount || 0
stockCount: item.stockCount || 0,
isMemberPrice: item.commodityUnitPrice.commodity.isMemberPrice ? 1 : 0
}
if (item.commodityUnitPrice.commodity.isMemberPrice) {
......@@ -582,7 +585,6 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
orderList: buyOrderlist
}]
}
buyOrderInfo.payWayList = await getPayWayListByMemberId(selectItem.memberId)
PublicApi.postOrderIsWorkFlow({ productIds, memberId: selectItem.memberId }).then(res => {
......
......@@ -472,6 +472,18 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
},
required: true,
title: '分配仓位库存',
"x-rules": [
{
validator: value => {
return value > Number.MAX_SAFE_INTEGER
},
message:'仓位库存数值已超出最大限度',
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '仓位库存数值仅限三位小数',
},
]
},
inventoryDeductWay: {
type: 'radio',
......
......@@ -104,6 +104,10 @@ const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status, type } = props
const statusText = typeMaps[type]
const statusShowColor = matchStatusColor(status)
// 单独处理支付比例 确认到账的状态颜色
if(type === 'payOut' && status === 3) {
return (<Tag color="#41CC9E">{statusText[status]}</Tag>)
}
return (<Tag color={statusShowColor}>{statusText[status]}</Tag>)
}
......
......@@ -11,145 +11,6 @@ import { history } from 'umi'
export interface OrderDeleveRecordProps {}
const outOrderCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'notDelivered',
align: 'center',
key: 'notDelivered',
},
{
title: '已收货',
dataIndex: 'goodsReceived',
align: 'center',
key: 'goodsReceived',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '发货数量',
dataIndex: 'deliverGoodsCount',
align: 'center',
key: 'deliverGoodsCount',
},
{
title: '入库数量',
dataIndex: 'storageCount',
align: 'center',
key: 'storageCount',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
// 订单发货记录
const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
......@@ -163,7 +24,149 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const outOrderCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: creditsCommodity ? '所需积分' : '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'notDelivered',
align: 'center',
key: 'notDelivered',
},
{
title: '已收货',
dataIndex: 'goodsReceived',
align: 'center',
key: 'goodsReceived',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '发货数量',
dataIndex: 'deliverGoodsCount',
align: 'center',
key: 'deliverGoodsCount',
},
{
title: '入库数量',
dataIndex: 'storageCount',
align: 'center',
key: 'storageCount',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideOrderCols: any[] = [
{
title: '发货批次',
......
......@@ -44,7 +44,8 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, preview }) => {
const { orderProductRequests = [], deliveryAddressInfo, freight = 0, sumPrice, amount } = dataSource || {}
const { orderProductRequests = [], deliveryAddressInfo, freight = 0, sumPrice, amount, orderModel } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
// 合计金额, 如果后端有传则用后端数据
const sum = amount || orderProductRequests.reduce((prev, next) => prev + parseInt((next.money || 0)), 0)
......@@ -84,7 +85,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
// }, [orderProductRequests])
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
......@@ -93,7 +94,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<div>{freight}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div>
</Col>
{/* <ModalForm
......@@ -196,7 +197,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `单价是必填的`,
message: `此项为必填项`,
},
]}
>
......@@ -215,7 +216,8 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
const { ctl, data, preview } = useContext(OrderDetailContext)
const { orderProductRequests = [] } = data || {}
const { orderProductRequests = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const productComponents = {
body: {
......@@ -301,7 +303,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
key: 'unit',
},
{
title: '单价(元)',
title: creditsCommodity ? '所需积分' : '单价(元)',
dataIndex: 'price',
align: 'left',
key: 'price'
......@@ -314,7 +316,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
render: (text, record) => record.isMemberPrice ? (text + '%') : null
},
{
title: '采购数量',
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......
......@@ -17,145 +17,6 @@ export interface OrderSaleRecordProps {
const { confirm } = Modal;
const outOrderCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'notDelivered',
align: 'center',
key: 'notDelivered',
},
{
title: '已收货',
dataIndex: 'goodsReceived',
align: 'center',
key: 'goodsReceived',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '发货数量',
dataIndex: 'deliverGoodsCount',
align: 'center',
key: 'deliverGoodsCount',
},
{
title: '入库数量',
dataIndex: 'storageCount',
align: 'center',
key: 'storageCount',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
// 订单发货记录
const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const pathname = history.location.pathname
......@@ -168,7 +29,148 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const outOrderCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: creditsCommodity ? '所需积分' : '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'notDelivered',
align: 'center',
key: 'notDelivered',
},
{
title: '已收货',
dataIndex: 'goodsReceived',
align: 'center',
key: 'goodsReceived',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '发货数量',
dataIndex: 'deliverGoodsCount',
align: 'center',
key: 'deliverGoodsCount',
},
{
title: '入库数量',
dataIndex: 'storageCount',
align: 'center',
key: 'storageCount',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideOrderCols: any[] = [
{
......
......@@ -85,7 +85,9 @@ const warehouseColumns: any[] = [
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { orderProductRequests = [], receiverAddressId, freight, amount } = dataSource || {}
const { orderProductRequests = [], receiverAddressId, freight, amount, orderModel } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const modelRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(freight || 0)
const [sum, setSum] = useState<number>(0)
......@@ -141,7 +143,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
......@@ -149,7 +151,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
<div>{freePrice}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div>
</Col>
<ModalForm
......@@ -267,11 +269,11 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `单价是必填的`,
message: `此项为必填项`,
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '价格数值仅限三位小数',
message: '数值仅限三位小数',
}
]}
>
......@@ -291,7 +293,8 @@ const EditableCell: React.FC<EditableCellProps> = ({
const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const { ctl, data } = useContext(OrderDetailContext)
const { page_type } = usePageStatus()
const { orderProductRequests = [] } = data || {}
const { orderProductRequests = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const [warehouseVisible, setWarehouseVisible] = useState(false)
const [checkProductId, setCheckProductId] = useState(0) // 选中的商品id
......@@ -392,7 +395,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
key: 'unit',
},
{
title: '单价(元)',
title: creditsCommodity ? '所需积分' : '单价(元)',
dataIndex: 'price',
align: 'left',
key: 'price',
......@@ -406,7 +409,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
render: (text, record) => record.isMemberPrice ? (text + '%') : null
},
{
title: '采购数量',
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount'
......
......@@ -15,11 +15,10 @@ const layout: any = {
};
export interface faceSetData {
set?: any,
get?: Function,
currentRef: any
}
const AddGoods: React.FC<faceSetData> = (props) => {
const { set, get, currentRef } = props
const { set, currentRef } = props
const [form] = Form.useForm();
const [type, setType] = useState<number>(0);
const btnname: Array<string> = ['添加商品', '选择货品', '导入货品']
......@@ -105,7 +104,6 @@ const AddGoods: React.FC<faceSetData> = (props) => {
settabledata([...newdata]);
setidx(-1);
}
get([...tabledata, data])
handleModal(type);
}
/** 编辑商品 */
......
......@@ -3,7 +3,7 @@ import { PublicApi } from '@/services/api'
import { FILTER_TYPE } from '@/constants'
interface FilterValueType {
key: string | string[] | number;
key: any;
title: string;
type: FILTER_TYPE;
}
......
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