Commit 455b8bf8 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'dev' into test

parents a3ad28d1 3229623c
This diff is collapsed.
......@@ -15,6 +15,7 @@ import styles from './index.less'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from '@formily/antd/esm/shared'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
interface ShopInfoPropsType {
SiteStore: {
......@@ -46,8 +47,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const fetchAllShop = () => {
//@ts-ignore
PublicApi.getManageShopFindShopsBySiteId({ siteId, type: 2 }).then(res => {
const param: any = {
siteId,
type: 2
}
PublicApi.getManageShopFindShopsBySiteId(param).then(res => {
if (res.code === 1000) {
setAllMallList(res.data)
}
......@@ -58,7 +62,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取渠道信息
*/
const fetchShopInfo = () => {
PublicApi.getTemplateChannelFindChannel().then(res => {
const { memberId } = getAuth() || {}
const param: any = {
memberId
}
PublicApi.getTemplateChannelFindChannel(param).then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
......@@ -92,7 +100,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const handleAddNewCitySelect = (item: any) => {
let temp = [...selectCityData]
const temp = [...selectCityData]
temp.push(item)
setSelectCityData(temp)
form.setFieldsValue({
......@@ -136,7 +144,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const handleSave = (e: any) => {
e.preventDefault()
form.validateFields().then(value => {
form.validateFields().then((value: any) => {
if (!checkmemberChannelAreas(value.memberChannelAreas)) {
return
}
......@@ -147,7 +155,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
value.storeUrl = storeUrl || `${siteUrl}/${GlobalConfig.channelRootRoute}`
value.shopId = shopId
setConfirmLoading(true)
//@ts-ignore
PublicApi.postTemplateChannelSaveChannel(value).then(res => {
if (res.code === 1000) {
fetchShopInfo()
......@@ -200,7 +208,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
/**
* 添加荣誉图片
* @param url
* @param url
*/
const handleAddhonorPics = (url: string) => {
setHonorPics([...honorPics, url])
......@@ -215,7 +223,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
return
}
if (shopInfo.shopId && shopInfo.memberId) {
let resUrl = getMallItemAndSetUrl(mallId)
const resUrl = getMallItemAndSetUrl(mallId)
setStoreUrl(resUrl)
} else {
setStoreUrl(null)
......@@ -225,7 +233,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const getMallItemAndSetUrl = (mallId) => {
let result = ""
let mallItem = allMallList.filter(item => item.id === mallId)[0]
const mallItem = allMallList.filter(item => item.id === mallId)[0]
if (!mallItem) {
return ""
}
......@@ -261,7 +269,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
return null
}
if (shopId && shopInfo.shopId && shopInfo.memberId) {
let resUrl = getMallItemAndSetUrl(shopId)
const resUrl = getMallItemAndSetUrl(shopId)
return resUrl ? (
<div className={styles.shop_url}>
<span>当前店铺链接:</span>
......@@ -396,7 +404,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
labelAlign="left"
name="customerUrl"
label={<RequireItem label="客服链接" />}
rules={[{ pattern: /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/, message: '请输入正确的客服链接' }]}
rules={[{ pattern: /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?/, message: '请输入正确的客服链接' }]}
>
<Input allowClear className={styles.form_item} />
</Form.Item>
......
......@@ -5,7 +5,7 @@ import SettingList from '../../../../components/SettingList'
import GoodsItem from './GoodsItem'
import SettingPanel from '../../../../components/SettingPanel'
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
import { GetTemplatePlatformFindGoodsListResponseDetail } from '@/services'
import { GetTemplatePlatformFindGoodsListResponseDetail } from '@/services/TemplateApi'
import { PublicApi } from '@/services/api'
import { filterProps } from '../../../../utils'
import styles from './index.less'
......@@ -44,7 +44,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [totalCount, setTotalCount] = useState<number>(0)
const [filterParam, setFilterParam] = useState()
const [spinLoading, setSpinLoading] = useState<boolean>(false)
const [newProps, setNewProps] = useState(props)
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [noSelectBrands, setNoSelectBrands] = useState<any[]>([])
......@@ -59,8 +58,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
categoryId: categoryid,
templateId: templateid
}
PublicApi.getTemplatePlatformFindCategoryList(param).then(res => {
PublicApi.getTemplateShopFindCategoryList(param).then(res => {
if (res.code === 1000) {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
......@@ -283,7 +281,10 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
</Button>
) : (
<Button
onClick={() => setOprationType('list')}
onClick={() => {
setOprationType('list')
setIsHighSearch(false)
}}
>
查看已选择商品({selectGoodsList.length})
</Button>
......
......@@ -21,7 +21,7 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
* @Date: 2020-10-12 11:36:38
* @Description: 新增生产通知单
*/
const formActions = createFormActions();
const { onFieldValueChange$, onFieldMount$ } = FormEffectHooks
......@@ -35,11 +35,11 @@ const Add: React.FC<{}> = () => {
// 加工订单 modal 框
const [modalOrderVisible, setModalOrderVisible] = useState<boolean>(false);
const [rowSelection, selectRowCtl] = useRowSelectionTable({
customKey: 'fullId',
const [rowSelection, selectRowCtl] = useRowSelectionTable({
customKey: 'fullId',
extendsSelection: {
getCheckboxProps: record => ({
disabled: record.purchaseCount - (record.processNum || 0) <= 0,
disabled: record.purchaseCount - (record.processNum || 0) <= 0,
}),
}
});
......@@ -69,13 +69,13 @@ const Add: React.FC<{}> = () => {
{ title: '加工数量', dataIndex: 'processNum' },
{ title: '加工单价', dataIndex: 'processUnitPrice' },
{ title: '加工费', dataIndex: 'processTotalPrice'},
{
title: '操作',
{
title: '操作',
render: (text, record) => {
const uniqueID = activeSource == '加工订单'? record.fullId : record.id
return (
<Space>
<ProcessDetail
<ProcessDetail
skuId={record.id}
uniqueID={uniqueID}
type={"view"}
......@@ -89,10 +89,10 @@ const Add: React.FC<{}> = () => {
>
<a>查看</a>
</ProcessDetail>
<ProcessDetail
<ProcessDetail
skuId={record.id}
uniqueID={uniqueID}
type={"edit"}
type={"edit"}
submit={handleChangeSomeList}
quantity={record.processNum}
processUnitPrice={record.processUnitPrice}
......@@ -107,24 +107,24 @@ const Add: React.FC<{}> = () => {
<a onClick={() => handleRemoveRow(uniqueID)}>删除</a>
</Space>
)
}
}
},
]
return activeSource !== '加工订单' ? tempColumns.filter((item) => !blackList.includes(item.dataIndex)) : tempColumns;
}
}
// 选择弹框 element
const tableAddButton = () => {
return (
<div>
<Button
onClick={handleShowProcessModal}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
<Button
onClick={handleShowProcessModal}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
选择{activeSource}
</Button>
</Button>
</div>
)
}
......@@ -134,7 +134,7 @@ const Add: React.FC<{}> = () => {
<Radio checked={true}>{activeSource}</Radio>
)
}
// 流转记录
// 流转记录
const RadioBtnGroup = () => {
return (
<Radio.Group
......@@ -151,7 +151,7 @@ const Add: React.FC<{}> = () => {
/**
* formEffect, 表单联动操作放这里操作,包括表单的生命周期等操作
*/
*/
const formEffects = () => () => {
onFieldValueChange$('source').subscribe((state) => {
if(state.mounted) {
......@@ -167,9 +167,9 @@ const Add: React.FC<{}> = () => {
let options = [];
if(res.code === 1000) {
options = res.data.data.map((item) => {
return {
label: `${item.fullAddress} / ${item.receiverName} / ${item.phone}`,
value: item.id
return {
label: `${item.fullAddress} / ${item.receiverName} / ${item.phone}`,
value: item.id
}}
)
}
......@@ -178,7 +178,7 @@ const Add: React.FC<{}> = () => {
})
})
})
/**
* 当改变物流地址的时候,那么修改隐藏的3个字段,
* 1. receiveAddress 详细的物流地址
......@@ -196,7 +196,7 @@ const Add: React.FC<{}> = () => {
formActions.setFieldValue("receiveUserTel", receiveUserTel.trim());
formActions.setFieldValue("receiverAddressId", state.value)
}
}
})
}
......@@ -205,7 +205,7 @@ const Add: React.FC<{}> = () => {
const handleShowProcessModal = () => {
const source = formActions.getFieldValue('source');
if(source == 1) {
setModalOrderVisible(true);
setModalOrderVisible(true);
} else {
setModalProductVisible(true)
}
......@@ -213,7 +213,7 @@ const Add: React.FC<{}> = () => {
/**
* 加工企业modal框 行勾选
* @param rows
* @param rows
*/
const enterPriseOnOk = (rows) => {
const { memberId, name, roleId } = rows.selectRow[0];
......@@ -246,7 +246,7 @@ const Add: React.FC<{}> = () => {
/**
* 加工商品Modal框 行勾选回调
* @param rows
* @param rows
*/
const processProductSelected = () => {
console.log(productSelectRowCtl);
......@@ -257,7 +257,7 @@ const Add: React.FC<{}> = () => {
/**
* 加工订单Modal框 行勾选回调
* @param row
* @param row
*/
const processOrderOnok = () => {
console.log(selectRowCtl);
......@@ -270,13 +270,12 @@ const Add: React.FC<{}> = () => {
* 提交表单
*/
const handleSubmit = (values: any) => {
console.log(values)
const SELF_MENTION = 2; // 自提
const {
deliveryDate,
const {
deliveryDate,
receivefullAddress,
// receiveAddressID,
enclosure = [],
// receiveAddressID,
enclosure = [],
deliveryDesc = '',
payDesc = '',
taxDesc = '',
......@@ -293,13 +292,13 @@ const Add: React.FC<{}> = () => {
if(isSomeFieldNotFill) {
message.error("通知单明细中有加工商品的加工数量或加工单价未填写");
return
return
}
setSubmitLoading(true);
const detailList = someLists.map((item) => {
return {
orederNo: item.orderNo, // 如果是商品加工,那么他没有订单号
productId: item.id, // skuid
productId: item.id, // skuid
productName: item.name,
category: item.customerCategoryName,
brand: item.brandName,
......@@ -332,7 +331,7 @@ const Add: React.FC<{}> = () => {
},
details:detailList
}
if(values.deliveryType == SELF_MENTION) {
delete postData.receiveAddress;
delete postData.receiveUserName;
......@@ -340,7 +339,6 @@ const Add: React.FC<{}> = () => {
delete postData.receiverAddressId
}
console.log(postData);
// return ;
PublicApi.postEnhanceSupplierToBeAddAdd(postData)
.then(data => {
setSubmitLoading(false);
......@@ -373,7 +371,7 @@ const Add: React.FC<{}> = () => {
/**
* 移除数据, 这里有个bug,移除数据时,对应的modal的rowSelection 没有跟着删除
* 尝试从父组件给rowSelection
* @param id
* @param id
*/
const handleRemoveRow = (id: number) => {
const currentList = formActions.getFieldValue('Tabs.tab-2.layout.someLists');
......@@ -403,7 +401,7 @@ const Add: React.FC<{}> = () => {
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
>
保存
</Button>,
]}
......@@ -424,22 +422,22 @@ const Add: React.FC<{}> = () => {
effects={formEffects()}
/>
{/* 加工企业 Modal 框 */}
<EnterPrise
visible={modalEnterPriseVisible}
<EnterPrise
visible={modalEnterPriseVisible}
cancel={() => setEnterPriseModalVisible(false)}
onOk={enterPriseOnOk}
></EnterPrise>
{/* 加工商品Modal框 */}
<ProcessProducts
visible={modalProductVisible}
cancel={() => setModalProductVisible(false)}
<ProcessProducts
visible={modalProductVisible}
cancel={() => setModalProductVisible(false)}
onOk={processProductSelected}
rowSelection={productRowSelection}
></ProcessProducts>
<ProcessOrder
visible={modalOrderVisible}
cancel={() => setModalOrderVisible(false)}
visible={modalOrderVisible}
cancel={() => setModalOrderVisible(false)}
onOk={processOrderOnok}
rowSelection={rowSelection}
>
......
......@@ -5,8 +5,7 @@ import classnames from 'classnames';
import {FileList, UploadFile} from '../../components/UploadFile';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd'
import {useScroll, useDebounceFn } from '@umijs/hooks';
import { min } from 'lodash';
import {useScroll } from '@umijs/hooks';
const actions = createFormActions();
const schema = {
......@@ -64,7 +63,6 @@ interface Iprops {
const Content: React.FC<Iprops> = React.forwardRef((props, conftentRef) => {
const { id, name, category, brand, unitName, files, productProps, quantity, processUnitPrice } = props;
const [active, setActive] = useState<string>("基本信息");
const [menu, setMenu] = useState([])
// const ref = useRef(null);
const [scroll, ref] = useScroll<HTMLDivElement>();
......
......@@ -2,7 +2,7 @@
.container {
// width: 1206px;
.header {
padding: 0 24px;
display: flex;
......@@ -26,7 +26,7 @@
font-weight: 400;
}
}
.images {
width: 216px;
height: 100%;
......@@ -60,10 +60,23 @@
margin-right: 12px;
border-radius: 50%;
// background-color: red;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
.randomLogo {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #4981CC 0%, #1A4F97 100%) #255BA3;
border-radius: 50%;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
}
}
.wrapper {
......@@ -90,10 +103,10 @@
}
}
}
}
......@@ -16,7 +16,7 @@ const WEEKDAYS = ["天", "一","二", "三", "四", "五","六"];
const LEVEL_IMAGE = [level1, level2, level3, level4];
const EDIT_USER_URL = '/memberCenter/memberAbility/query';
const USER_CENTER_URL = '/memberCenter/memberAbility/manage/maintain'
const STATUS_COLOR = ["default", "processing", "error", "success"]
const STATUS_COLOR: ("default" | "processing" | "error" | "success")[] = ["default", "processing", "error", "success"]
const UserCenter: React.FC<Iprops> = () => {
const today = moment();
......@@ -37,7 +37,7 @@ const UserCenter: React.FC<Iprops> = () => {
</div>
<div className={styles.date}>
{today.format('YYYY年MM月DD日')} 星期{WEEKDAYS[today.day()]}
</div>
</div>
</div>
<div className={styles.images}>
<img src={home_user} />
......@@ -46,13 +46,14 @@ const UserCenter: React.FC<Iprops> = () => {
<div className={styles.content}>
<Row className={styles.row}>
<Col span={11} className={styles.user}>
{/* http://10.0.0.25:4000/project/15/interface/api/38926 上传用户头像 */}
<div className={styles.pic} >
{
userAuth.logo
? <img src={userAuth.logo || ''} />
: <div></div>
: <div className={styles.randomLogo}>H</div>
}
</div>
<div className={styles.wrapper}>
<div className={styles.company}>
......@@ -91,4 +92,4 @@ const UserCenter: React.FC<Iprops> = () => {
)
}
export default UserCenter
\ No newline at end of file
export default UserCenter
......@@ -371,7 +371,13 @@ const CommodityDetail = (props) => {
postFn = PublicApi.postSearchShopPurchaseSaveOrUpdatePurchase
break;
}
PublicApi.postOrderDirectPayment({ productId: selectCommodityId, memberId }).then(res => {
const directParam: any = {
productId: selectCommodityId,
memberId,
shopId
}
PublicApi.postOrderDirectPayment(directParam).then(res => {
if (res.code === 1000) {
message.destroy()
postFn && postFn(param).then(res => {
......@@ -483,8 +489,12 @@ const CommodityDetail = (props) => {
if (clickFlag) {
clickFlag = false
PublicApi.postOrderDirectPayment({ productId: selectCommodityId, memberId }).then(res => {
const param: any = {
productId: selectCommodityId,
memberId,
shopId
}
PublicApi.postOrderDirectPayment(param).then(res => {
if (res.code === 1000) {
message.destroy()
const buyCommodityInfo = {
......
......@@ -6,6 +6,7 @@ import { LAYOUT_TYPE, FILTER_TYPE } from '@/constants'
import { PublicApi } from '@/services/api'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
import { Layout } from '@formily/antd'
const CheckboxGroup = Checkbox.Group
......@@ -29,6 +30,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const [initSelectAttributeList, setInitSelectAttributeList] = useState<any>([])
useEffect(() => {
console.log(JSON.stringify(filterList))
if (isEmpty(filterList)) {
setSelectedKeys([])
setLastCategoryId(null)
......@@ -39,6 +41,8 @@ const Category: React.FC<CategoryPropsType> = (props) => {
for (const item of filterList) {
if (item.type === FILTER_TYPE.category) {
initKeys.push(String(item.key))
} else if(item.type === FILTER_TYPE.customerCategory) {
initKeys.push(String(item.key))
}
if (item.type === FILTER_TYPE.attribute) {
setInitSelectAttributeList(item.key)
......@@ -186,7 +190,6 @@ const Category: React.FC<CategoryPropsType> = (props) => {
}
const handleSelect = (selectedKeys, info) => {
console.log(info)
const { title, children, name } = info.node
setSelectedKeys(selectedKeys)
if (children.length === 0) {
......@@ -196,17 +199,31 @@ const Category: React.FC<CategoryPropsType> = (props) => {
} else {
setLastCategoryId(null)
setAttributeList([])
onFilter({
type: FILTER_TYPE.attribute,
key: null,
title: ``
})
if(filterList.some(item => item.type === FILTER_TYPE.attribute)) {
onFilter({
type: FILTER_TYPE.attribute,
key: null,
title: ``
})
}
}
onFilter({
type: FILTER_TYPE.category,
key: selectedKeys,
title: typeof title === 'string' ? title : name
})
switch(layoutType) {
case LAYOUT_TYPE.mall:
onFilter({
type: FILTER_TYPE.category,
key: selectedKeys,
title: typeof title === 'string' ? title : name
})
break
default:
onFilter({
type: FILTER_TYPE.customerCategory,
key: selectedKeys,
title: typeof title === 'string' ? title : name
})
break
}
}
const handleExpand = (expandedKeys) => {
......
......@@ -35,7 +35,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const [loading, setLoading] = useState<boolean>(true)
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
......@@ -61,7 +61,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
}, [query])
const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
......@@ -73,7 +73,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (shopInfo) {
body.className = shopInfo.channelShopTemplateFileName ? `theme-channel-${shopInfo.channelShopTemplateFileName}` : templateName;
} else {
......
......@@ -35,7 +35,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const [loading, setLoading] = useState<boolean>(true)
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
const { formatMessage } = useIntl();
......@@ -61,7 +61,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
}, [query])
const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
......@@ -73,7 +73,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (shopInfo) {
body.className = shopInfo.channelOwnShopTemplateFileName ? `theme-channel-${shopInfo.channelOwnShopTemplateFileName}` : templateName;
} else {
......
......@@ -32,7 +32,7 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const [mallInfo, setMallInfo] = useState<any>({})
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
......@@ -50,12 +50,12 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const getWebMallInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
let webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0]
const webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0]
setMallInfo(webMallInfo)
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (!isEmpty(mallTemplateInfo)) {
body.className = mallTemplateInfo.fileName ? `theme-mall-${mallTemplateInfo.fileName}` : templateName;
} else {
......
......@@ -25,12 +25,13 @@ interface OrderPropsType {
mallInfo: any;
layoutType: LAYOUT_TYPE;
shopUrlParam: string;
shopId: number;
}
const Order: React.FC<OrderPropsType> = (props) => {
let checkoutCount = 0
const userInfo = getAuth()
const { shopInfo, mallInfo, layoutType, shopUrlParam } = props
const { shopInfo, mallInfo, layoutType, shopUrlParam, shopId } = props
const { query: { type = COMMODITY_TYPE.prompt } } = props.location
const [signModalVisible, setSignModalVisible] = useState<boolean>(false)
const { spam_id } = props.location.query
......@@ -266,6 +267,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
const params: any = {
orderModel: getOrderMode(), // 下单模式
needTheInvoice: needTheInvoice ? 1 : 0,
shopId
}
if (orderInfo.logistics.deliveryType === 1 && !!selectAddressInfo) {
......
......@@ -16,5 +16,6 @@
font-weight: 500;
// color: #303133;
display: inline-block;
cursor: pointer;
}
}
\ No newline at end of file
}
......@@ -3,13 +3,11 @@ import { history } from 'umi';
import { Card, List, Avatar } from 'antd';
import styles from './index.less'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PlusOutlined } from '@ant-design/icons';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import moment from 'moment';
import msg_system from '@/assets/imgs/msg_system.png'
import msg_platform from '@/assets/imgs/msg_platform.png';
import cx from 'classnames';
const Message: React.FC<{}> = () => {
const [dataSource, setDataSource] = useState<any>([])
......@@ -17,7 +15,7 @@ const Message: React.FC<{}> = () => {
current: 1,
pageSize: 10,
}
useEffect(() => {
// @ts-ignore
......@@ -41,7 +39,6 @@ const Message: React.FC<{}> = () => {
}
const handlePaginationChange = (page, pageSize) => {
console.log(page,pageSize);
getList({page, pageSize})
.then((data) => {
console.log(data);
......@@ -51,17 +48,20 @@ const Message: React.FC<{}> = () => {
const handleRead = (id, url: string) => {
console.log(url);
// /report/message/member/read
PublicApi.getReportMessageMemberRead({id: id})
.then((data) => {
if(url) {
history.push(url);
if(/http/.test(url)) {
location.href = url
} else {
history.push(url);
}
}
})
}
const renderMessage = (data) => {
return (
<>
<StatusTag type={data.type == 1 ? 'primary' : 'success'} title={data.type == 1 ? '系统消息': '平台消息'} />
......@@ -79,7 +79,7 @@ const Message: React.FC<{}> = () => {
<PageHeaderWrapper>
<Card
title="消息列表"
>
>
<List
itemLayout="horizontal"
dataSource={dataSource.data}
......
......@@ -25,11 +25,12 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const isDeleved = pathname.indexOf('readyConfirmDelevedOrder') !== -1
// 是否是确认回单页
const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1
console.log(isPreview, isDeleved, isReturn)
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel, externalState } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const outOrderCols: any[] = [
......@@ -113,8 +114,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
key: 'differenceCount',
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
......@@ -341,10 +342,13 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
childrenDataKey='orderDeliveryProducts'
dataSource={orderDeliveryDetailsResponses}
/>
<Space style={{marginTop: 18, display: "flex", justifyContent: "flex-end"}}>
<Button type="primary" onClick={handelReciveReturnOrder}>确认本单全部发货单已收到回单</Button>
<Button type="primary" onClick={handleContinueDeliver}>继续发货</Button>
</Space>
{
externalState === 11 && !isPreview && isReturn &&
<Space style={{marginTop: 18, display: "flex", justifyContent: "flex-end"}}>
<Button type="primary" onClick={handelReciveReturnOrder}>确认本单全部发货单已收到回单</Button>
<Button type="primary" onClick={handleContinueDeliver}>继续发货</Button>
</Space>
}
</Tabs.TabPane>
}
</Tabs>
......@@ -356,4 +360,4 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
OrderSaleRecord.defaultProps = {}
export default OrderSaleRecord
\ No newline at end of file
export default OrderSaleRecord
......@@ -363,7 +363,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
})
ctl.setData({
...data,
orderProductRequests: newData
orderProductRequests: newData.sort((a, b) => a.id - b.id)
})
};
......@@ -479,7 +479,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
<MellowCard title='订单商品' style={{marginTop: 24}} bordered={false}>
<Table
columns={columns}
dataSource={orderProductRequests}
dataSource={orderProductRequests.sort((a, b) => a.id - b.id)}
components={productComponents}
rowKey='id'
pagination={false}
......
......@@ -4,7 +4,6 @@ import { Row, Space, Popover } from 'antd'
import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants'
import { EnvironmentOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import { toPercent } from '@/utils/type'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -71,7 +70,7 @@ export const orderCombination = {
]
}
export const orderTypeLabel = ['',
export const orderTypeLabel = ['',
'现货采购',
'现货采购',
'询价采购',
......@@ -278,15 +277,11 @@ export const productInfoColumns: any[] = [
align: 'left',
key: 'unitPrice',
render: (t, r) => {
// if(r?.commodityId) {
// return <PriceComp priceSection={r.unitPrice}/>
// } else {
// return r.price
// }
if(JSON.stringify(r.unitPrice) === '{}') {
return r.price
} else {
// todo 还差需求报价的商品数据字段对比
if(r?.commodityId) {
return <PriceComp priceSection={r.unitPrice}/>
} else {
return <span style={{color: 'red'}}>{r.price}</span>
}
}
},
......@@ -295,7 +290,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? toPercent(text) : null
render: (text, record) => record.isMemberPrice && text ? text * 100 + '%' : null
},
{
title: '采购数量',
......@@ -328,7 +323,7 @@ export const productInfoColumns: any[] = [
render: (t, r) => {
if(r.logistics?.deliveryType === 1)
return "物流(默认)"
else if(r.logistics?.deliveryType === 2)
else if(r.logistics?.deliveryType === 2)
return "自提"
else if(r.logistics?.deliveryType === 3)
return "无需配送"
......@@ -379,4 +374,4 @@ export const mergeOrderColumns: any[] = [
align: 'center',
key: 'none',
}
]
\ No newline at end of file
]
......@@ -59,12 +59,12 @@ const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsync
// return v
// }))
// }
// 配送方式请求
// const asyncAddressRequests = productData.filter(v => v.distributeMode !== undefined)
}
export const createEffects = context => () => {
}
export const useModelTypeChange = (callback) => {
......@@ -89,14 +89,13 @@ export const useEditHideField = () => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
const { value } = state
console.log(value, 'vlaue')
const payInfoData = ctx.getFieldValue('paymentInformationResponses')
// 强制渲染一次, 用于触发金额总数
update()
// // 已经存在数据 无需请求
// if (payInfoData && payInfoData.length > 0) {
// } else
// } else
if (value && value.length > 0){
// 请求一次并复制给支付信息
const productItem = value[0]
......@@ -157,7 +156,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// query中存在modelType参数, 则是从其他页面跳转而来,需禁用其余query选项
// 商城跳转过来的数据
const initValue = JSON.parse(window.sessionStorage.getItem(spam_id))
// 从商城跳转, 需回显数据
if (initValue) {
const fn = async (initValue) => {
......@@ -175,17 +174,18 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
prev[next.range] = next.price
return prev
}, {}),
isMemberPrice: !!v.memberDiscount,
isMemberPrice: v.isMemberPrice,
purchaseCount: v.count,
money: v.count * v.unitPrice,
productId: v.id,
memberId: initValue.supplyMembersId, // 添加 memberId 字段
commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他)
memberPrice: v.memberDiscount !== 1 ? toPercent(v.memberDiscount) : 1, // 添加会员折扣
memberPrice: v.memberDiscount !== 1 ? v.memberDiscount : 1, // 添加会员折扣
}
})))
})
))
}
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
ctx.setFieldState('orderModel', state => {
state.remoteDataFn = fn
......@@ -196,7 +196,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
fn(initValue)
}
// 写入收货地址数据
useProductAddress(ctx)
})
......@@ -209,7 +209,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
}
export const useProductAddress = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
fetchOrderApi.getProductAddressAll().then(data => {
ctx.setFieldState('deliveryAddresId', state => {
if (data.length > 0 && !state.value) {
......
......@@ -55,7 +55,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
const receiverAddressId = form.getFieldValue('deliveryAddresId')
const sum = data.reduce((prev, next) => prev + (next.money || 0), 0)
const [freePrice, setFreePrice] = useState<number>(0)
useEffect(() => {
if (sum + freePrice) {
form.notify('sumPrice', sum + freePrice)
......@@ -72,7 +72,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
orderProductList: logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId,
weight: v.logistics.weight,
count: v?.purchaseCount || 0
count: v?.purchaseCount || null
})),
receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId
}, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
......@@ -84,7 +84,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
}
}, [data])
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
......@@ -161,7 +161,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
shopDataRef.current = Object.assign({}, shopDataRef.current, item)
}
}
}, [])
const handleSubmit = async (value) => {
try {
......@@ -274,7 +274,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// @todo 未实现金额合计
const couponAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>选择优惠券</Button>
// 新增收货地址
const addNewAddress = <Button block icon={<PlusOutlined/>}>新增收货地址</Button>
......@@ -326,25 +326,25 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
]}
>
<ReadyAddOrderDetailContext.Provider value={providerValue}>
{ pageStatus !== PageStatus.ADD && initFormValue && initFormValue.externalWorkflowFlowRecordLogResponses && <AuditProcess
{ pageStatus !== PageStatus.ADD && initFormValue && initFormValue.externalWorkflowFlowRecordLogResponses && <AuditProcess
customTitleKey='operationalProcess'
customKey='state'
outerVerifyCurrent={findLastIndexFlowState(initFormValue.externalWorkflowFlowRecordLogResponses)}
innerVerifyCurrent={findLastIndexFlowState(initFormValue.interiorWorkflowFlowRecordLogResponses)}
outerVerifyCurrent={findLastIndexFlowState(initFormValue.externalWorkflowFlowRecordLogResponses)}
innerVerifyCurrent={findLastIndexFlowState(initFormValue.interiorWorkflowFlowRecordLogResponses)}
outerVerifySteps={
initFormValue.externalWorkflowFlowRecordLogResponses ?
initFormValue.externalWorkflowFlowRecordLogResponses ?
initFormValue.externalWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
}
innerVerifySteps={
initFormValue.interiorWorkflowFlowRecordLogResponses ?
initFormValue.interiorWorkflowFlowRecordLogResponses ?
initFormValue.interiorWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
></AuditProcess> }
......@@ -416,12 +416,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const { value, editable } = state
// 报价单的值 等同于是否填写过报价单
const quotationOrderValue = ctx.getFieldValue('quotationNo')
// 当选择了手工下单、渠道直采手工下单、渠道现货手工下单、或者选择了合并订单下单并未选择报价单则需要显示商品列表添加接口
if (
value === OrderModalType.HAND_ORDER ||
value === OrderModalType.CHANNEL_DIRECT_MINING_ORDER ||
value === OrderModalType.CHANNEL_SPOT_MANUAL_ORDER ||
value === OrderModalType.CHANNEL_SPOT_MANUAL_ORDER ||
(value === OrderModalType.CONSOLIDATED_ORDER && quotationOrderValue)
) {
addSchemaAction.setFieldState('orderProductRequests', productState => {
......@@ -476,4 +476,4 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
PurchaseOrderDetail.defaultProps = {}
export default PurchaseOrderDetail
\ No newline at end of file
export default PurchaseOrderDetail
......@@ -48,9 +48,9 @@ export const getUnitPriceTotal = (record) => {
// let memberPrice = record.memberPrice !== 1 ? toPoint(record.memberPrice) : 1
let memberPrice = record.memberPrice
if(record.isMemberPrice) {
return unitPrice * purchaseCount * memberPrice
return Number((unitPrice * purchaseCount * memberPrice).toFixed(2))
} else {
return unitPrice * purchaseCount
return Number((unitPrice * purchaseCount).toFixed(2))
}
}
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
......@@ -79,7 +79,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
} else {
return [...productInfoColumns].slice(0, productInfoColumns.length - 1)
}
return productInfoColumns
})
const handleShowProduct = () => {
......@@ -105,7 +105,6 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
const item = newData[index];
console.log(getUnitPriceTotal(row), 'row')
row['money'] = getUnitPriceTotal(row)
// 新增的时候接口字段id,commodityId 编辑的时候id,productId
row['productId'] = row?.commodityId ? row.id : row.productId
......@@ -146,4 +145,4 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
}
......@@ -184,7 +184,7 @@ const basicInfo: ISchema = {
type: 'number',
display: false
},
orderNo: {
type: 'string',
title: '订单编号',
......@@ -213,7 +213,7 @@ const basicInfo: ISchema = {
},
}
},
}
}
// 订单商品
......@@ -449,7 +449,7 @@ const auditRecord: ISchema = {
}
}
}
}
}
......@@ -485,7 +485,7 @@ const electronicResult: ISchema = {
}
}
}
}
}
// 流转记录
......@@ -597,4 +597,4 @@ export const mergeAllSchemas = {
4: orderElectronicSchema,
// 订单支付
5: orderDetailSchema
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@ import { Button, Row, Col, Progress, Popconfirm } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderOutWorkState } from '@/constants'
import { ORDER_TYPE, PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/constants'
import StatusColors from '../../components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import {
......@@ -136,8 +136,8 @@ export const useSelfTable = (props) => {
<Col>{record.currentPayments} / {record.sum}</Col>
{/* <Col>
{
record.currentPayments !== record.sum &&
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
record.currentPayments !== record.sum &&
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
}
</Col> */}
......@@ -152,17 +152,22 @@ export const useSelfTable = (props) => {
key: 'ctl',
render: (text, record) => <>
{
record.currentPayments !== record.sum &&
record.currentPayments !== record.sum &&
(
record.externalState === PurchaseOrderOutWorkState.PAY_ORDER ||
record.externalState === PurchaseOrderOutWorkState.PAY_ORDER ||
record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT ||
record.externalState === PurchaseOrderOutWorkState.NOT_PAYMENT_FINAL ||
record.externalState === PurchaseOrderOutWorkState.CONFIRM_WITHOUT_ARRIVED_ACCOUNT
) &&
) &&
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
}
{
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER && !record.signatureLogId || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
(
record.externalState === PurchaseOrderOutWorkState.PAY_ORDER &&
!record.signatureLogId ||
record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT &&
record.interiorState !== PurchaseOrderInsideWorkState.PAY_SUCCESS
) &&
<Popconfirm
title="是否要取消该订单?"
onConfirm={() => handleCancel(record.id)}
......
......@@ -64,7 +64,7 @@ export const useSelfTable = () => {
},
{ title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 收货单号跳转
{ title: '入库单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> },
{ title: '收货单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> },
{
title: '订单类型',
align: 'center',
......@@ -93,7 +93,7 @@ export const useSelfTable = () => {
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) &&
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button>
}
</>
......
......@@ -12,7 +12,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 待确认支付结果订单
export interface FirstApprovedOrderProps {}
......@@ -64,4 +63,4 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder
\ No newline at end of file
export default FirstApprovedOrder
......@@ -64,7 +64,13 @@ export const useSelfTable = () => {
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转
{ title: '发货单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> },
{
title: '发货单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.invoiceId}&preview=1`}>{text}</Link>
},
// { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text},
{
title: '订单类型',
......@@ -94,10 +100,10 @@ export const useSelfTable = () => {
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button>
}
</>
......
......@@ -60,7 +60,7 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: text => '¥' + text
render: (t, r) => (r.type === 7 || r.type === 8) ? t : '¥' + t
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转
......@@ -93,7 +93,7 @@ export const useSelfTable = () => {
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
{ (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button>
}
</>
......
......@@ -78,29 +78,29 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const tableAddButton = <Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} disabled={pageStatus === PageStatus.PREVIEW} onClick={handleAddProductBtn} type='dashed'>选择指定商品</Button>
const tableColumns = [
{
{
dataIndex: 'id',
title: 'ID',
key: 'id'
},
{
dataIndex: 'name',
title: '商品名称',
{
dataIndex: 'name',
title: '商品名称',
key: 'name',
render: (_, record) => <EyePreview url={`/memberCenter/commodityAbility/commodity/products/detail?id=${record.commodityId}`}>{_}</EyePreview>
render: (_, record) => <EyePreview url={`/memberCenter/commodityAbility/commodity/products/detail?id=${record.commodityId}`}>{_}</EyePreview>
},
{
dataIndex: 'customerCategoryName',
title: '品类',
title: '品类',
key: 'customerCategoryName'
},
{
dataIndex: 'brandName',
{
dataIndex: 'brandName',
title: '品牌',
key: 'brandName'
},
{
dataIndex: 'priceType',
{
dataIndex: 'priceType',
title: '商品定价',
key: 'priceType',
render: (text:any, reocrd:any)=>{
......@@ -112,10 +112,10 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
return '积分兑换商品'
},
},
{
dataIndex: 'ctl',
title: '操作',
render: (_, record) => <Button type='link' disabled={pageStatus === PageStatus.PREVIEW} onClick={() => handleDeleteTable(record.id)}>删除</Button>
{
dataIndex: 'ctl',
title: '操作',
render: (_, record) => <Button type='link' disabled={pageStatus === PageStatus.PREVIEW} onClick={() => handleDeleteTable(record.id)}>删除</Button>
}
]
......@@ -136,28 +136,28 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
const columnsSetProduct: any[] = [
{
{
dataIndex: 'id',
title: 'ID',
key: 'id'
},
{
dataIndex: 'name',
title: '商品名称',
{
dataIndex: 'name',
title: '商品名称',
key: 'name'
},
{
dataIndex: 'customerCategoryName',
{
dataIndex: 'customerCategoryName',
title: '品类',
key: 'customerCategoryName'
},
{
dataIndex: 'brandName',
title: '品牌',
{
dataIndex: 'brandName',
title: '品牌',
key: 'brandName'
},
{
dataIndex: 'priceType',
{
dataIndex: 'priceType',
title: '商品定价',
key: 'priceType',
render: (text:any, reocrd:any)=>{
......@@ -203,7 +203,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down',
className: 'fixed-ant-selected-down',
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
style: {
width: 160
......@@ -239,7 +239,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
async function getInitValue() {
const { data } = await PublicApi.getOrderTradingRulesDetails({id: id})
if(data.isTacitlyApprove === 2) {
const res = await getBindingProducts({id: id.toString(), current: '1', pageSize: '10'})
const res = await getBindingProducts({id: id.toString(), current: '1', pageSize: '1000'})
addSchemaAction.setFieldState('products', state => {
state.value = res.data
})
......@@ -289,7 +289,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
productsLength
}}
components={{
SelectProcesss,
SelectProcesss,
}}
effects={($, { setFieldState }) => {
FormEffectHooks.onFormInputChange$().subscribe(() => {
......@@ -324,9 +324,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
ctx: {
schema: formProduct,
components: {
ctx: {
schema: formProduct,
components: {
ModalSearch: Search,
SearchSelect, Submit,
} ,
......@@ -347,10 +347,10 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
/>
</>
)
}
RuleSetting.defaultProps = {}
export default RuleSetting
\ No newline at end of file
export default RuleSetting
......@@ -176,7 +176,6 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
rowKey: 'id',
columns: "{{tableColumns}}",
prefix: "{{tableAddButton}}",
idNotList: []
}
}
}
......
......@@ -138,6 +138,9 @@ class FilterStore {
case FILTER_TYPE.category:
tempFilterParam.categoryId = Number(filterItem.key[0])
break
case FILTER_TYPE.customerCategory:
tempFilterParam.customerCategoryId = Number(filterItem.key[0])
break
case FILTER_TYPE.commodityType:
tempFilterParam.priceTypeList = [filterItem.key]
break
......@@ -202,6 +205,10 @@ class FilterStore {
tempFilterParam.customerCategoryId = filterItem.key[0]
tempFilterParam.customerCategoryName = filterItem.title
break
case FILTER_TYPE.customerCategory:
tempFilterParam.customerCategoryId = filterItem.key[0]
tempFilterParam.customerCategoryName = filterItem.title
break
case FILTER_TYPE.brand:
tempFilterParam.brandId = filterItem.key
tempFilterParam.brandName = filterItem.title
......
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