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