Commit 0fdb080f authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents f8a59c3c 52eeb0ac
......@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-02 19:14:41
* @LastEditTime: 2020-09-07 14:59:52
*/
const TranactionRoute = {
......@@ -102,6 +102,12 @@ const TranactionRoute = {
key:'enquiryTwo',
component: '@/pages/transaction/enquirySubmit/enquiryTwo'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/toSubmit',
name:'toSubmit',
key:'toSubmit',
component: '@/pages/transaction/enquirySubmit/toSubmit'
}
]
},
// 采购订单
......
......@@ -55,7 +55,7 @@ const serviceConfig = {
// // }
// }
}
}
// 批量组装接口
......@@ -82,7 +82,7 @@ async function batchAxiosHttps() {
const serverErrorQueue = []
console.log('\n')
for (const item in serviceConfig) {
if(JSON.stringify(item) !== '{}'){
if (JSON.stringify(item) !== '{}') {
for (const subItem in serviceConfig[item]) {
try {
const data = await axios(serviceConfig[item][subItem])
......@@ -90,12 +90,12 @@ async function batchAxiosHttps() {
if (data.data.code === 1000) {
asyncHttpQueue[item][subItem] = data.data.data
} else {
serverErrorQueue.push({ ...asyncHttpQueue[item][subItem], ...data.data})
serverErrorQueue.push({ ...asyncHttpQueue[item][subItem], ...data.data })
// 默认置为null
asyncHttpQueue[item][subItem] = null
}
} catch(err) {
httpErrorQueue.push({...serviceConfig[item][subItem], ...err.response.data})
} catch (err) {
httpErrorQueue.push({ ...serviceConfig[item][subItem], ...err.response.data })
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-04 17:28:55
* @LastEditTime: 2020-09-07 15:02:47
*/
export default {
......@@ -116,6 +116,7 @@ export default {
'menu.tranactionAbility.enquirySubmit.enquiryOne': '待审核报价单(一级)',
'menu.tranactionAbility.enquirySubmit.viewEnquiryDetail': '需求报价单',
'menu.tranactionAbility.enquirySubmit.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.enquirySubmit.toSubmit': '待提交需求单',
'menu.tranactionAbility.purchaseOrder': '采购订单',
'menu.tranactionAbility.purchaseOrder.purchaseOrderSearch': '订单查询',
'menu.tranactionAbility.purchaseOrder.readyAddOrder': '待新增订单',
......
......@@ -12,6 +12,7 @@ import { MALL_TYPE } from '@/constants'
import copy from 'copy-to-clipboard'
import cx from 'classnames'
import styles from './index.less'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from '@formily/antd/esm/shared'
interface ShopInfoPropsType {
......@@ -34,6 +35,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const [workshopPics, setWorkshopPics] = useState([]) // 厂房照片
const [honorPics, setHonorPics] = useState([]) // 资质荣誉
const [logo, setLogo] = useState<string>("")
const [shopInfo, setShopInfo] = useState<GetTemplateChannelFindChannelResponse>()
const [shopId, setShopId] = useState<number>()
useEffect(() => {
......@@ -58,6 +60,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
PublicApi.getTemplateChannelFindChannel().then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
setSelectCityData(initMemberShopArea(data.memberChannelAreas))
setLogo(data.logo)
setShopId(data.shopId)
......@@ -209,11 +212,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
let selectItem = allMallList.filter(item => item.id === mallId)
setShopId(mallId)
if (mallId) {
setStoreUrl(`${siteUrl}/${selectItem[0].url}?id=${1}`)
setStoreUrl(`${siteUrl}/channelMall?id=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`)
// setStoreUrl(`${siteUrl}/${selectItem[0].url}?id=${1}`)
} else {
setStoreUrl(null)
}
}
const handleFormValueChange = () => {
......@@ -333,7 +336,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
<Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}>
{
allMallList.map(item => (
<Select.Option key={item.id} value={item.id}>{MALL_TYPE[item.type]}</Select.Option>
<Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
))
}
</Select>
......@@ -346,7 +349,6 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</div>
)
}
</Form.Item>
<Form.Item
labelAlign="left"
......
......@@ -35,7 +35,7 @@ const ShopTemplate: React.FC = () => {
<Row gutter={24} className={styles.template_list}>
{
templateList.map(item => (
<Col span={6} key={item.id}>
<Col xxl={6} xl={8} lg={12} key={item.id}>
<TemplateItem templateInfo={item} type="shop" />
</Col>
))
......
import React from 'react'
import React, { useEffect } from 'react'
import { ScienceTemplate } from './template'
import { GetSearchShopStoreGetCommodityDetailResponse } from '@/services/SearchApi'
import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
interface IntroductionPropsType {
......@@ -9,88 +12,20 @@ interface IntroductionPropsType {
const Introduction: React.FC<IntroductionPropsType> = (props) => {
const { commodityDetail } = props
const SiteStore = useLocalStore(() => store.SiteStore)
const { commodityTemplateInfo, findUseGoodsTemplate } = SiteStore
const data = [
{
label: '主要用途',
value: '皮鞋、皮带、箱包、其他用途'
},
{
label: '皮层',
value: '二层'
},
{
label: '风格',
value: '荔枝纹'
},
{
label: '张幅皮形',
value: '自然张'
},
{
label: '颜色',
value: '黑色、红色、黄色、橙色、咖啡色'
},
{
label: '厚度',
value: '1.0mm ~ 1.5mm'
},
{
label: '产地',
value: '无'
},
{
label: '尺码保障',
value: '83%'
},
{
label: '取样',
value: '无'
},
{
label: '等级',
value: '统级'
},
{
label: '保税',
value: '是'
},
{
label: '备注',
value: '统级'
},
{
label: '编号',
value: '无'
},
{
label: '材质',
value: '无'
},
{
label: '国际色卡',
value: '无'
},
{
label: '手感',
value: '无'
},
{
label: '七天无理由退换货',
value: '无'
},
{
label: '交货地',
value: '无'
},
{
label: '商品状态',
value: '无'
},
]
useEffect(() => {
if (isEmpty(commodityTemplateInfo)) {
findUseGoodsTemplate()
}
}, [])
useEffect(() => {
}, [commodityTemplateInfo])
const renderIntroduction = () => {
let templateName = 'science'
let templateName = commodityTemplateInfo.fileName || 'science'
switch (templateName) {
case 'science':
return <ScienceTemplate />
......@@ -116,4 +51,4 @@ const Introduction: React.FC<IntroductionPropsType> = (props) => {
)
}
export default Introduction
export default observer(Introduction)
......@@ -9,6 +9,8 @@ import Exhibition from './components/Exhibition'
import BrowseRecords from './components/BrowseRecords'
import Interested from './components/Interested'
import ShopInfo from './components/ShopInfo'
import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import ProductDescription from './components/ProductDescription'
import InputNumber from '@/components/InputNumber'
import { PublicApi } from '@/services/api'
......@@ -71,11 +73,23 @@ const CommodityDetail = (props) => {
if (res.code === 1000) {
setCommodityDetail(res.data)
initAttributeAndValueList(res.data?.unitPriceAndPicList)
getPayWayListByMemberId(res.data?.memberId)
res.data?.isMemberPrice && getMemberCredit(res.data?.memberId, res.data?.memberRoleId)
}
})
}
const getPayWayListByMemberId = (memberId: number) => {
if (!memberId) {
return
}
//@ts-ignore
PublicApi.getPayPayWayList({ memberId }).then(res => {
})
}
const getMemberCredit = (memberId, memberRoleId) => {
let param = {
parentMemberId: memberId,
......@@ -158,7 +172,12 @@ const CommodityDetail = (props) => {
message.info("请选择商品属性")
return
}
history.push(`/order`)
PublicApi.postOrderIsWorkFlow({ productIds: [selectCommodityId] }).then(res => {
if (res.code === 1000) {
message.destroy()
history.push(`/order?commodityId=${selectCommodityId}&scence=buy`)
}
})
}
const renderBtn = () => {
......@@ -486,4 +505,4 @@ const CommodityDetail = (props) => {
)
}
export default CommodityDetail
export default observer(CommodityDetail)
......@@ -23,14 +23,15 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const { fetchCategoryList, categoryList } = props.CategoryStore
useEffect(() => {
console.log(type, "type")
let getCategoryFn
let params: any = {}
switch (type) {
case LAYOUT_TYPE.mall:
params.templateId = mallTemplateId
getCategoryFn = PublicApi.getTemplatePlatformFindAllCategoryTree
fetchCategoryList(getCategoryFn, params, type)
if (mallTemplateId) {
params.templateId = mallTemplateId
getCategoryFn = PublicApi.getTemplatePlatformFindAllCategoryTree
fetchCategoryList(getCategoryFn, params, type)
}
break
case LAYOUT_TYPE.shop:
if (shopId) {
......@@ -46,7 +47,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
break
}
}, [props])
}, [props, mallTemplateId])
return (
<div className={styles.category}>
......
......@@ -16,6 +16,17 @@ interface MainNavPropsType {
const MainNav: React.FC<MainNavPropsType> = (props) => {
const { menuData, pathname, type, shopId, shopUrlParam } = props
const getNavLink = (item) => {
switch (type) {
case LAYOUT_TYPE.shop:
return `${item.path}?shopId=${shopUrlParam}`
case LAYOUT_TYPE.channel:
return `${item.path}?id=${shopUrlParam}`
default:
return item.path
}
}
return (
<div className={cx(styles.main_nav, type === LAYOUT_TYPE.shop ? styles.shop : "")}>
<div className={styles.main_nav_container}>
......@@ -24,7 +35,7 @@ const MainNav: React.FC<MainNavPropsType> = (props) => {
{
menuData && menuData.map(item => !item.hide && (
<li className={cx(styles.nav_item, item.path === pathname ? styles.active : '')} key={item.key}>
<Link to={type === LAYOUT_TYPE.shop ? `${item.path}?shopId=${shopUrlParam}` : item.path}>{item.name}</Link>
<Link to={getNavLink(item)}>{item.name}</Link>
</li>
))
}
......
......@@ -71,6 +71,7 @@
flex: 1;
display: flex;
align-items: center;
margin-right: 8px;
&>span {
font-size: 14px;
......
......@@ -23,10 +23,12 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>()
useEffect(() => {
getCategoryComponents()
findFirstAdvertsByType()
findSecondAdvertsByType()
}, [])
if (mallTemplateId) {
getCategoryComponents()
findFirstAdvertsByType()
findSecondAdvertsByType()
}
}, [mallTemplateId])
const findFirstAdvertsByType = () => {
let params = {
......@@ -80,7 +82,9 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
// @ts-ignore
PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => {
resolve(res.data)
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
......
......@@ -5,8 +5,11 @@ import {
} from '@ant-design/pro-layout'
import SelectLang from '@/layouts/components/SelectLang'
import { useIntl } from 'umi'
import { LAYOUT_TYPE } from "@/constants"
import { inject, observer } from 'mobx-react'
import TopBar from '../components/TopBar'
import { PublicApi } from '@/services/api'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import ChannelHeader from '../components/ChannelHeader'
import MainNav from '../components/MainNav'
import SideNav from '../components/SideNav'
......@@ -25,6 +28,9 @@ interface LXMallLayoutPropsType {
const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const { children, location } = props
const [templateName] = useState<string>('theme-channel-science')
const { id } = location.query
const [shopInfo, setShopInfo] = useState<GetTemplateChannelFindChannelResponse>()
const [query, setQuery] = useState<any>({})
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
......@@ -36,10 +42,34 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const menuRouter = getMenuRouter(menuData, location.pathname)
useEffect(() => {
let body = document.getElementsByTagName('body')[0]
body.className = templateName
let queryParam = id ? atob(id) : undefined
queryParam = queryParam ? JSON.parse(queryParam) : {}
setQuery(queryParam)
}, [])
useEffect(() => {
if (query.memberId) {
fetchShopInfo(query.memberId)
}
}, [query])
const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
}
})
}
useEffect(() => {
if (shopInfo) {
let body = document.getElementsByTagName('body')[0];
body.className = shopInfo.fileName ? `theme-shop-${shopInfo.fileName}` : templateName;
}
}, [shopInfo])
return (
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} />
......@@ -48,7 +78,7 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
!menuRouter?.hideHeader && (
<>
<ChannelHeader />
<MainNav menuData={menuData} pathname={location.pathname} type="channel" />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.channel} shopId={query.shopId} shopUrlParam={id} />
</>
)
}
......@@ -56,7 +86,11 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
children && React.Children.map(children, (child: any) => {
return React.cloneElement(child,
{
layoutType: 'channel'
layoutType: 'channel',
shopId: query.shopId,
memberId: query.memberId,
shopUrlParam: id,
shopInfo
},
);
})
......
......@@ -6,11 +6,13 @@ import {
import SelectLang from '@/layouts/components/SelectLang'
import { useIntl } from 'umi'
import { inject, observer } from 'mobx-react'
import { LAYOUT_TYPE } from '@/constants'
import TopBar from '../components/TopBar'
import Header from '../components/Header'
import MainNav from '../components/MainNav'
import SideNav from '../components/SideNav'
import Footer from '../components/Footer'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
interface LXMallLayoutPropsType {
......@@ -25,7 +27,9 @@ interface LXMallLayoutPropsType {
const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const { children, location } = props
const [templateName] = useState<string>('theme-mall-science')
const { siteId } = props.SiteStore
const { siteId, mallTemplateInfo, findUseMallTemplate } = props.SiteStore
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
......@@ -37,10 +41,18 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const menuRouter = getMenuRouter(menuData, location.pathname)
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
body.className = templateName;
if (isEmpty(mallTemplateInfo)) {
findUseMallTemplate()
}
}, [])
useEffect(() => {
if (!isEmpty(mallTemplateInfo)) {
let body = document.getElementsByTagName('body')[0];
body.className = mallTemplateInfo.fileName ? `theme-mall-${mallTemplateInfo.fileName}` : templateName;
}
}, [mallTemplateInfo])
return (
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} />
......@@ -49,7 +61,7 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
!menuRouter?.hideHeader && (
<>
<Header />
<MainNav menuData={menuData} pathname={location.pathname} type="mall" />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.mall} />
</>
)
}
......@@ -57,7 +69,7 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
children && React.Children.map(children, (child: any) => {
return React.cloneElement(child,
{
layoutType: 'mall'
layoutType: 'mall',
},
);
})
......
......@@ -41,16 +41,12 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
let queryParam = shopId ? atob(shopId) : undefined
queryParam = queryParam ? JSON.parse(queryParam) : {}
setQuery(queryParam)
let body = document.getElementsByTagName('body')[0];
body.className = templateName;
}, [])
useEffect(() => {
if (query.memberId) {
console.log()
fetchShopInfo(query.memberId)
}
}, [query])
const fetchShopInfo = (memberId) => {
......@@ -62,6 +58,13 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
})
}
useEffect(() => {
if (shopInfo) {
let body = document.getElementsByTagName('body')[0];
body.className = shopInfo.fileName ? `theme-shop-${shopInfo.fileName}` : templateName;
}
}, [shopInfo])
const { formatMessage } = useIntl();
const basicInfo = getMenuData(props.route.routes, { locale: true }, formatMessage)
const menuData = basicInfo.menuData ? basicInfo.menuData.filter(item => !item.redirect) : []
......
......@@ -8,7 +8,7 @@ import CitySelect from '@/components/CitySelect'
import RequireItem from '@/components/RequireItem'
import { PublicApi } from '@/services/api'
import UploadImage from '@/components/UploadImage'
import { MALL_TYPE } from '@/constants'
import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
import copy from 'copy-to-clipboard'
import cx from 'classnames'
import styles from './index.less'
......@@ -33,6 +33,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const [workshopPics, setWorkshopPics] = useState([]) // 厂房照片
const [honorPics, setHonorPics] = useState([]) // 资质荣誉
const [logo, setLogo] = useState<string>("")
const [shopInfo, setShopInfo] = useState<GetTemplateShopFindShopResponse>()
const [shopId, setShopId] = useState<number>()
useEffect(() => {
......@@ -61,6 +62,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
PublicApi.getTemplateShopFindShop().then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
setSelectCityData(initMemberShopArea(data.memberShopAreas))
setLogo(data.logo)
setShopId(data.shopId)
......@@ -210,11 +212,10 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
let selectItem = allMallList.filter(item => item.id === mallId)
setShopId(mallId)
if (mallId) {
setStoreUrl(`${siteUrl}/${selectItem[0].url}?id=${1}`)
setStoreUrl(`${siteUrl}/shop?shopId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`)
} else {
setStoreUrl(null)
}
}
const handleFormValueChange = () => {
......@@ -334,7 +335,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}>
{
allMallList.map(item => (
<Select.Option key={item.id} value={item.id}>{MALL_TYPE[item.type]}</Select.Option>
<Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
))
}
</Select>
......
......@@ -35,7 +35,7 @@ const ShopTemplate: React.FC = () => {
<Row gutter={24} className={styles.template_list}>
{
templateList.map(item => (
<Col span={6} key={item.id}>
<Col xxl={6} xl={8} lg={12} key={item.id}>
<TemplateItem templateInfo={item} type="shop" />
</Col>
))
......
......@@ -7,4 +7,13 @@ export const interiorState = (text:any) => {
text === 3 ? component = <Badge status='success' text="审核通过" />:
component = <Badge status='error' text="审核不通过" />
return component;
}
export const interiorStateTwo = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 3 ? component = <Badge status='processing' text="待审核" />:
text === 4 ? component = <Badge status='success' text="审核通过" />:
component = <Badge status='error' text="审核不通过" />
return component;
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
type: number|string;//1是一级 2是二级
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
......@@ -24,12 +25,22 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log(values)
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
console.log('value',value)
if(props.type == 1){
PublicApi.postOrderRequisitionFormAudit(value).then(res => {
if (res.code === 1000) {
console.log(123123)
props.onOK()
}
})
}else if(props.type == 2){
PublicApi.postOrderRequisitionFormAuditTwo(value).then(res => {
if (res.code === 1000) {
console.log(123123)
props.onOK()
}
})
}
}
useEffect(() => {
......@@ -38,16 +49,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
......@@ -59,7 +63,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
return (
<>
<Modal
title='单据确认'
title='审核确认'
width={800}
visible={props.dialogVisible}
onOk={() => actions.submit()}
......@@ -67,10 +71,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText='取消'
cancelText={`取消`}
>
<SchemaForm
labelCol={3}
labelCol={4}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
......@@ -78,42 +82,30 @@ const comfirmDialog: React.FC<Params> = (props) => {
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
state: 1
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='status'
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
{props.dontReceive &&
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
title='审核不通过原因'
name="cause"
x-component="TextArea"
required
x-component-props={{
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-04 16:10:27
* @LastEditTime: 2020-09-08 11:06:06
*/
import React, { Component, useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Modal, Table, Tooltip, Input, Select, Button, Popconfirm, Card, Tag, Badge, Steps, Tabs, } from 'antd'
......@@ -20,7 +20,7 @@ import {PageStatus,usePageStatus} from '@/hooks/usePageStatus'
import { dockingColumn,externalColumn,interiorColumn } from '../../common/detailFormColumnType'
import moment from 'moment'
import style from './index.less'
import {interiorState} from '../../common/tableStatusList'
import {interiorState,interiorStateTwo} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
const { Step } = Steps
const { TabPane } = Tabs
......@@ -52,6 +52,7 @@ interface dataInfoType {
const detailInfo: React.FC<{}> = () => {
const ref = useRef<any>({})
const [pagetype, setpagetype] = useState(history.location.query.page_type)
let interiorStateList = []
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<any>({
......@@ -59,7 +60,8 @@ const detailInfo: React.FC<{}> = () => {
externalState: 0,
interiorState: 0,
externalRequisitionFormStateResponses:[],
interiorRequisitionFormStateResponses:[]
interiorRequisitionFormStateResponses:[],
requisitionFormAddress:[]
})
const [shipperAddress, setshipperAddress] = useState('')
const {pageStatus, id} = usePageStatus()
......@@ -311,13 +313,31 @@ const detailInfo: React.FC<{}> = () => {
//在这做逻辑判断 判断路由 是由哪个页面进来的
useEffect(() => {
let pathname = history.location.pathname
init()
}, [])
const init = () => {
PublicApi.getOrderRequisitionFormDetails({ id: id }).then(res => {
let {data} = res
if(pagetype == 2){
if(data.interiorState === 3){//一级的审核通过变为2级的待审核
data.interiorState = 2
}
}
setdataInfo(data)
interiorStateList = [...data.interiorRequisitionFormStateResponses]
console.log('44',data.interiorRequisitionFormStateResponses,interiorStateList)
if(pagetype == 1 || pagetype == 2){
if(data.interiorState === 2){
setIsextraOption(true)
}
}else if(pagetype == 3){
if(dataInfo.externalState == 1){
setIsextraOption(true)
}
}
PublicApi.getLogisticsSelectListShipperAddress().then(res => {
res.data.forEach(item => {
if(data.addresId === item.id){
......@@ -327,12 +347,16 @@ const detailInfo: React.FC<{}> = () => {
})
})
}
return () => {
}
}, [])
/**
* @description: 状态改变就刷新数据
* @param {type}
* @return {type}
*/
useEffect(() => {
init()
},[dataInfo.interiorState])
const formTime = (text) => {
return <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
......@@ -388,15 +412,34 @@ const detailInfo: React.FC<{}> = () => {
return res.data
}
/**
* @description: 弹窗确认
* @param {type}
* @return {type}
*/
const handleModalOK = () => {
console.log('5555')
setvisible(false)
ref.current.reload()
setTimeout(()=> {
history.goBack()
},1000)
}
const interiorData = [
{
operationTime:1598853606806
}
]
const handlediaSubmit = (type:number) => {
if(type == 1){//提交需求单
PublicApi.postOrderSubmitRequisitionForm({id: id}).then(res => {
if(res.code === 1000){
setTimeout(()=> {
history.goBack()
},1000)
}
})
}
}
return (
<PageHeaderWrapper
......@@ -406,24 +449,41 @@ const detailInfo: React.FC<{}> = () => {
<div className={style['headerTop']}>
<div className={style['headerTop-prefix']}></div>
<div className={style['headerTop-name']}>
物流单号:{dataInfo.logisticsOrderNo}
需求单号:{dataInfo.logisticsOrderNo}
</div>
<div className={style[`levelIcon${'1'}`]}></div>
</div>
</>
}
extra={
isextraOption &&
(isextraOption &&
<>
<Button onClick={() => setvisible(true)}>
<StopOutlined />
不接受物流单
</Button>
<Button onClick={() => setvisible(true)} className={style['saveBtn']}>
<CheckSquareOutlined />
接受物流单
</Button>
</>
{
(pagetype == 1 || pagetype == 2) &&
<>
<Button onClick={() => setvisible(true)}>
<StopOutlined />
审核不通过
</Button>
<Button onClick={() => setvisible(true)} className={style['saveBtn']}>
<CheckSquareOutlined />
审核通过
</Button>
</>
}
{
(pagetype == 3) &&
<Button type="primary" onClick={() => handlediaSubmit(1)}>
<CheckSquareOutlined />
提交
</Button>
}
</>)
}
content={
<div className={style['headerMain']}>
......@@ -462,7 +522,9 @@ const detailInfo: React.FC<{}> = () => {
<div>内部状态:</div>
<div>
{
interiorState(dataInfo.interiorState)
pagetype === 1 ? interiorState(dataInfo.interiorState) :
pagetype === 2 || pagetype == 3? interiorStateTwo(dataInfo.interiorState) : ''
}
</div>
</div>
......@@ -515,6 +577,19 @@ const detailInfo: React.FC<{}> = () => {
<div className={style['mainCol-title']}>
适合地市
</div>
<Row className={style['mainCol-rows']}>
{
dataInfo.requisitionFormAddress.length > 0 ?
dataInfo.requisitionFormAddress
.map((item,index) => {
return <Col key={index} span={8}>
{item.province}/{ item.city}
</Col>
})
:'所有地市'
}
</Row>
</Col>
<Col className={style['mainCol']} span={24}>
<div className={style['mainCol-title']}>
......@@ -536,7 +611,7 @@ const detailInfo: React.FC<{}> = () => {
{item.title}
</div>
<div className={style['cols-main-options']}>
<Button type='link'>{item.value}</Button>
{item.value}
</div>
</div>
);
......@@ -625,10 +700,11 @@ const detailInfo: React.FC<{}> = () => {
</Col>
</Row>
<ConfirmModal
type={pagetype}
id={id}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK}
onOK={ handleModalOK}
/>
</PageHeaderWrapper>
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-02 19:44:31
* @LastEditTime: 2020-09-07 16:01:17
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
......@@ -29,7 +29,7 @@ import {
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import {interiorState} from '../../common/tableStatusList'
import {interiorState,interiorStateTwo} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
......@@ -42,7 +42,7 @@ import { enquierySchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
/**
* @description: 按页面来 type一级为1 二级为2
* @description: 按页面来 type一级为1 二级为2 待提交需求单3
* @param {type}
* @return {type}
*/
......@@ -68,10 +68,10 @@ const List:React.FC<listParams> = (props) => {
const res = await PublicApi.getOrderRequisitionFormAuditTwoList(params);
return res.data
}
// else{
// const res = await PublicApi.getOrderRequisitionFormAwaitList(params);
// return res.data
// }
else if(props.type === 3){//待提交需求单
const res = await PublicApi.getOrderRequisitionFormSubmitList(params);
return res.data
}
}
/**
......@@ -80,7 +80,7 @@ const List:React.FC<listParams> = (props) => {
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?id=${id}`)
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${props.type}&id=${id}`)
}
const columns : ColumnType<any>[] = [
......@@ -146,7 +146,9 @@ const List:React.FC<listParams> = (props) => {
key:'interiorState',
dataIndex:'interiorState',
align:'center',
render:(text:any) => interiorState(text)
render:(text:any) =>
props.type === 1 ? interiorState(text) :
props.type === 2 || props.type == 3? interiorStateTwo(text) : ''
},
{
title:'操作',
......@@ -159,13 +161,17 @@ const List:React.FC<listParams> = (props) => {
<>
{
(props.type === 1 || props.type === 2) ?
<Button type="link" onClick={() => {}}>审核</Button>
<Button type="link" onClick={() =>
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${props.type}&id=${record.id}`)}>
审核
</Button>
:
<>
{
(record.interiorState !== 3 &&
<Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
)
(props.type === 3 && record.externalState === 1) &&
<Button type="link" onClick={() =>
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${props.type}&id=${record.id}`)}>
提交</Button>
}
{
(record.externalState === 1 && record.interiorState === 1) &&
......@@ -213,9 +219,19 @@ const List:React.FC<listParams> = (props) => {
if(ids.length === 0){
return
}
PublicApi.postOrderSubmitRequisitionFormAll({ ids: ids }).then(res => {
ref.current.reload()
})
if(props.type === 1){//一级
PublicApi.postOrderRequisitionFormAuditAll({ ids: ids }).then(res => {
ref.current.reload()
})
}else if(props.type === 2){//二级
PublicApi.postOrderRequisitionFormAuditAllTwo({ ids: ids }).then(res => {
ref.current.reload()
})
}else if(props.type === 3){//待提交审核
PublicApi.postOrderSubmitRequisitionFormAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
}
//提交审核
......@@ -255,12 +271,14 @@ const List:React.FC<listParams> = (props) => {
<Col span={24}>
<Space direction="horizontal" size={16}>
{
(props.type !== 1 && props.type !== 2)&&
(props.type !== 1 && props.type !== 2 && props.type !== 3)&&
<Button type="primary" onClick={() => history.push('/memberCenter/tranactionAbility/enquirySubmit/addEnquiry')} icon={<PlusOutlined/>}>新建</Button>
}
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>
{ (props.type == 1 || props.type == 2) ? '批量提交审核' :'批量审核通过'}
</Button>
{
(props.type !== 1 && props.type !== 2)&&
(props.type !== 1 && props.type !== 2 && props.type !== 3)&&
<>
<Dropdown.Button
overlay={menu}
......
import React, { Component } from 'react'
import OrderList from "../components/index"
const List = () => {
return (
<OrderList des='待提交需求单' type={3}/>
)
}
export default List
\ No newline at end of file
import { action, computed, observable, runInAction } from 'mobx'
import { ISiteModule } from '@/module/siteModule';
import { GlobalConfig } from '@/global/config';
import { ISiteModule } from '@/module/siteModule'
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api'
class SiteStore implements ISiteModule {
// 可在根目录下的demo.js修改数据
@observable public siteId: number = GlobalConfig.global.siteId; // 站点id
@observable public siteUrl: string = GlobalConfig.global.siteUrl; // 站点域名
@observable public mallTemplateId: number = 852; // 企业商城模板id
@observable public mallTemplateId: number = null; // 企业商城模板id
@observable public mallTemplateInfo: any = {}; // 企业商城模板id
@observable public shopTemplateId: number = 708; // 店铺模板id
@observable public channelTemplateId: number = 903; // 渠道模板id
@observable public commodityTemplateInfo: any = {}
/**
* 根据站点查询正在使用的商城模板
*/
@action.bound
public findUseMallTemplate = async () => {
const tempMallTemplateInfo = sessionStorage.getItem("mallTemplateInfo")
if (tempMallTemplateInfo) {
this.mallTemplateInfo = JSON.parse(tempMallTemplateInfo)
this.mallTemplateId = this.mallTemplateInfo.id
return
}
//@ts-ignore
const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite({ siteId: this.siteId })
runInAction(() => {
this.mallTemplateInfo = res.data
this.mallTemplateId = this.mallTemplateInfo.id
sessionStorage.setItem("mallTemplateInfo", JSON.stringify(this.mallTemplateInfo))
})
}
/**
* 根据站点查询正在使用的商品描述模板
*/
@action.bound
public findUseGoodsTemplate = async () => {
const tempCommodityTemplateInfo = sessionStorage.getItem("commodityTemplateInfo")
if (tempCommodityTemplateInfo) {
this.commodityTemplateInfo = JSON.parse(tempCommodityTemplateInfo)
return
}
//@ts-ignore
const res = await PublicApi.getTemplateGoodsFindUseGoodsTemplate({ siteId: this.siteId })
runInAction(() => {
this.commodityTemplateInfo = res.data
sessionStorage.setItem("commodityTemplateInfo", JSON.stringify(this.commodityTemplateInfo))
})
}
}
export default SiteStore
......@@ -5,7 +5,7 @@ const tokenList = [
{ name: 'Member', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' }, // 商户会员管理服务
{ name: 'Product', token: 'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4' }, // 商品服务
{ name: 'Template', token: '7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb' }, // 店铺模板服务
{ name: 'Pay', token: 'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49' }, // 支付服务
{ name: 'Pay', token: '34608cd33222b1650795459d73b8eb0b260eb92cf5e8d1e646f85a4875e36f05' }, // 支付服务
{ name: 'Search', token: 'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48' }, // 搜索服务
{ name: 'Order', token: '5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' }, //订单服务
// { name: '', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' } // 商户会员管理服务
......
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