Commit 95f8b048 authored by XieZhiXiong's avatar XieZhiXiong
parents 1b6e4219 dcfcaa99
......@@ -121,13 +121,13 @@ const HandlingRoute = {
hideInMenu: true,
},
// 指派生产通知单 -> 新建加工入库单
{
path: '/memberCenter/handling/assign/createProcessStock',
name: 'createProcessStock',
icon: 'smile',
component: '@/pages/handling/assign/processStock/createProcessStock',
hideInMenu: true,
}
// {
// path: '/memberCenter/handling/assign/createProcessStock',
// name: 'createProcessStock',
// icon: 'smile',
// component: '@/pages/handling/assign/processStock/createProcessStock',
// hideInMenu: true,
// }
]
},
// 确认生产通知单
......@@ -142,6 +142,13 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/confirm/Query',
},
{
path: '/memberCenter/handling/confirm/query/detail',
name: 'confirmProductionQuery',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 待提交生产通知单
{
path: '/memberCenter/handling/confirm/pendingSubmit',
......@@ -149,6 +156,14 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/confirm/Query'
},
// // 确认生产通知单 -> 待提交生产通知单详情
{
path: '/memberCenter/handling/confirm/pendingSubmit/detail',
name: 'confirmProductionQueryDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 待审核通知单(一级)
{
path: '/memberCenter/handling/confirm/pendingFirst',
......@@ -156,6 +171,13 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/confirm/Query'
},
{
path: '/memberCenter/handling/confirm/pendingFirst/detail',
name: 'pendingFirstDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 待审核通知单(二级)
{
path: '/memberCenter/handling/confirm/pendingSecond',
......@@ -163,6 +185,13 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/confirm/Query'
},
{
path: '/memberCenter/handling/confirm/pendingSecond/detail',
name: 'pendingSecondDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 待确认生产通知单
{
path: '/memberCenter/handling/confirm/pendingConfirm',
......@@ -170,12 +199,20 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/confirm/Query',
},
// // 确认生产通知单 -> 待确认生产通知单详情
{
path: '/memberCenter/handling/confirm/pendingConfirm/detail',
name: 'pendingConfirmDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 待新增加工发货单
{
path: '/memberCenter/handling/confirm/processingInvoiceTobeAdd',
name: 'processingInvoiceTobeAdd',
icon: 'smile',
component: '@/pages/handling/confirm/Query',
component: '@/pages/handling/assign/processStock',
},
// 确认生产通知单 -> 新建加工发货单
// {
......
......@@ -38,6 +38,7 @@
"@antv/data-set": "^0.11.5",
"@formily/antd": "^1.3.3",
"@formily/antd-components": "^1.3.3",
"@types/crypto-js": "^4.0.1",
"@umijs/hooks": "^1.9.3",
"@umijs/plugin-esbuild": "^1.0.1",
"@umijs/preset-react": "1.x",
......@@ -45,6 +46,7 @@
"antd-img-crop": "^3.12.0",
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
"god": "^0.2.1",
"immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.8",
......
......@@ -2,7 +2,6 @@ import { IRoutes } from '.';
import { history, RequestConfig, Redirect } from 'umi';
import React from 'react'
import MobxProvider from './store'
import queryString from 'query-string'
import '@/global/styles/reset.less'; // 重置antd样式
import '@/global/styles/global.less'; // 导入全局样式
......@@ -179,11 +178,17 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if (whiteLists.includes(location.pathname)) {
return
}
const authInfo = getAuth()
// 是否登录
if (getAuth()) {
if (authInfo) {
const routeAuthUrls = getRouters()
let routeAuthUrls = getRouters()
if (!routeAuthUrls || routeAuthUrls.length === 0) {
const { urls } = authInfo
routeAuthUrls = urls
setRouters(urls)
}
const { pathname } = location
if (userLoginLists.includes(pathname)) {
// 当登录过, 并且尝试访问登录相关页面, 需重定向到首页
......@@ -208,7 +213,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
return;
}
// 无权限访问时
console.log(pathname)
// console.log(pathname)
history.replace('/memberCenter/noAuth')
} else {
if (whiteLists.includes(location.pathname)) {
......
export const NOT_CHANGE_VALUE = 'hello, world'
// socket的链接地址, 默认会使用后端接口网关地址
export const SOCKET_URL = process.env.SOCKET_URL?.replace('http', 'ws') || process.env.BACK_GATEWAY?.replace('http', 'ws') || "ws://10.0.0.25:9400"
export const SOCKET_URL = process.env.SOCKET_URL?.replace('http|https', 'ws') || process.env.BACK_GATEWAY?.replace('http|https', 'ws') || "ws://10.0.0.25:9400"
console.log(SOCKET_URL);
export const MALL_TYPE = {
1: '企业商城',
......
......@@ -473,10 +473,14 @@ export default {
'menu.handling.assign.toBeRecieveDetail': '待收货生产通知单详情',
'menu.handling.confirm': '确认生产通知单',
'menu.handling.confirm.confirmProductionQuery': '生产通知单查询',
'menu.handling.confirm.confirmProductionQueryDetail': '生产通知单详情',
'menu.handling.confirm.pendingSubmit': '待提交生产通知单',
'menu.handling.confirm.pendingFirst': '待审核生产通知单(一级)',
'menu.handling.confirm.pendingFirstDetail': '待审核生产通知单(一级)详情',
'menu.handling.confirm.pendingSecond': '待审核生产通知单(二级)',
'menu.handling.confirm.pendingSecondDetail': '待审核生产通知单(二级)详情',
'menu.handling.confirm.pendingConfirm': '待确认生产通知单',
'menu.handling.confirm.pendingConfirmDetail': '待确认生产通知单详情',
'menu.handling.confirm.processingInvoiceTobeAdd': '待新增加工发货单',
'menu.handling.confirm.pendingAddLogistics': '待新增物流单',
'menu.handling.confirm.pendingDelivered': '待发货生产通知单',
......
......@@ -325,6 +325,8 @@ const Add: React.FC<{}> = () => {
if(data.code === 1000) {
history.push('/memberCenter/handling/assign/tobeAddQuery')
}
}).finally(() => {
setSubmitLoading(false);
})
}
......
import React, {useState, useEffect} from 'react';
import React, {useState, useEffect, useCallback} from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import AvatarWrap from '@/components/AvatarWrap';
import { PageHeader, Descriptions, Card, Tabs, Row, Col, Button } from 'antd';
import { PageHeader, Descriptions, Card, Tabs, Row, Col, Button, Select } from 'antd';
import Circulation from '../../components/Circulation';
import WrapTable from '../../components/WrapTable';
import OtherRequirement from '../../components/OtherRequirement';
......@@ -16,6 +16,8 @@ import { columns, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn, receiv
import ExamineModal from '../../components/ExamineModal';
import { FormOutlined } from '@ant-design/icons'
// 下面的地址需要抽离出来, 还有以下的相同的path
const SERVICE_MAP = {
'/memberCenter/handling/assign/query/detail': PublicApi.getEnhanceSupplierAllDetails,
'/memberCenter/handling/assign/tobeAddQuery/detail': PublicApi.getEnhanceSupplierToBeAddDetails,
......@@ -23,6 +25,11 @@ const SERVICE_MAP = {
'/memberCenter/handling/assign/pendingSecond/detail': PublicApi.getEnhanceSupplierToBeSecondExamDetails,
'/memberCenter/handling/assign/pendingSubmit/detail': PublicApi.getEnhanceSupplierToBeSubmitDetails,
'/memberCenter/handling/assign/pendingReceive/detail': PublicApi.getEnhanceSupplierToBeReceiveDetails,
'/memberCenter/handling/confirm/query/detail': PublicApi.getEnhanceProcessAllDetails,
'/memberCenter/handling/confirm/pendingSubmit/detail': PublicApi.getEnhanceProcessToBeSubmitExamDetails,
'/memberCenter/handling/confirm/pendingFirst/detail': PublicApi.getEnhanceProcessToBeFirstExamDetails,
'/memberCenter/handling/confirm/pendingSecond/detail': PublicApi.getEnhanceProcessToBeSecondExamDetails,
'/memberCenter/handling/confirm/pendingConfirm/detail': PublicApi.getEnhanceProcessToBeConfirmDetails
}
/**
......@@ -30,18 +37,26 @@ const SERVICE_MAP = {
*/
const EXAM_SERVICE = {
'/memberCenter/handling/assign/pendingFirst/detail': PublicApi.postEnhanceSupplierToBeFirstExamExam,
'/memberCenter/handling/assign/pendingSecond/detail': PublicApi.postEnhanceSupplierToBeSecondExamExam
'/memberCenter/handling/assign/pendingSecond/detail': PublicApi.postEnhanceSupplierToBeSecondExamExam,
'/memberCenter/handling/confirm/pendingSubmit/detail': PublicApi.postEnhanceProcessToBeSubmitExamExam,
'/memberCenter/handling/confirm/pendingFirst/detail': PublicApi.postEnhanceProcessToBeFirstExamExam,
'/memberCenter/handling/confirm/pendingSecond/detail': PublicApi.postEnhanceProcessToBeSecondExamExam,
'/memberCenter/handling/confirm/pendingConfirm/detail': PublicApi.postEnhanceProcessToBeConfirmExam
}
const { TabPane } = Tabs;
const Detail: React.FC<{}> = () => {
const pathname = history.location.pathname;
const [info, setInfo] = useState<any>({})
const { id } = usePageStatus();
const pathname = history.location.pathname;
const [loading, setLoading] = useState<boolean>(false);
const [deliverAddressOption, setDeliverAddressOption] = useState([]);
const [activeAddress, setActiveAddress] = useState<string | null>(null)
const isSetDeliverAddress = pathname == '/memberCenter/handling/confirm/pendingSubmit/detail';
useEffect(() => {
if(id) {
SERVICE_MAP[pathname]({id: id})
const service = SERVICE_MAP[pathname];
service && service({id: id})
.then(({data, code}) => {
if(code === 1000) {
setInfo(data);
......@@ -50,6 +65,36 @@ const Detail: React.FC<{}> = () => {
}
}, [id]);
// 确认生产通知单 -> 待提交审核生产通知单时需要同时提交他的发货地址
useEffect(() => {
if(isSetDeliverAddress) {
PublicApi.getLogisticsShipperAddressPage({current: '1', pageSize: '20'})
.then(({data, code}) => {
if(code === 1000) {
const tempData = [];
let defaultAddress = null;
data.data.forEach((item) => {
if(item.isDefault) {
defaultAddress = item.id.toString()
}
tempData.push({
label: `${item.fullAddress}/${item.shipperName}/${item.phone}`,
value: item.id.toString()
})
}
);
setActiveAddress(defaultAddress);
setDeliverAddressOption(tempData);
}
})
}
}, [])
//确认生产通知单 -> 需要提交发货地址,那么这个时候需要监听Select的change事件
const deliverAddressOnChange = useCallback((value) => {
setActiveAddress(value)
}, [])
// 审核
const examOnOk = ({text, status}) => {
let tempData = {
......@@ -58,8 +103,22 @@ const Detail: React.FC<{}> = () => {
}
setLoading(true)
const postData = status == 1 ? tempData : {...tempData, cause: text};
EXAM_SERVICE[pathname](postData)
const deliverTarget = deliverAddressOption.filter((item) => item.value === activeAddress)[0];
const [fullAddress, shipperName, phone] = deliverTarget && deliverTarget.label.split("/")|| '';
const withDeliverAddress = isSetDeliverAddress
? {
...postData,
deliveryMessage: {
deliveryAddressId: activeAddress,
deliveryAddress: fullAddress,
deliveryUserName: shipperName,
deliveryUserTel: phone,
}
}
: postData
EXAM_SERVICE[pathname](withDeliverAddress)
.then(({code, data}) => {
setLoading(false);
if(code == 1000) {
setLoading(false)
history.go(-1)
......@@ -77,6 +136,7 @@ const Detail: React.FC<{}> = () => {
if(code === 1000) {
history.go(-1);
}
}).finally(() => {
setLoading(false)
})
}
......@@ -88,13 +148,17 @@ const Detail: React.FC<{}> = () => {
<Button loading={loading} type="primary" >单据审核</Button>
</ExamineModal>
)
const SubmitBtn = <Button icon={<FormOutlined />} onClick={submit} type="primary"> 提交通知单</Button>
const Component_MAP = {
const SubmitBtn = <Button loading={loading} icon={<FormOutlined />} onClick={submit} type="primary"> 提交通知单</Button>
const COMPONENT_MAP = {
'/memberCenter/handling/assign/pendingSubmit/detail': SubmitBtn,
'/memberCenter/handling/assign/pendingFirst': ExamineComponent,
'/memberCenter/handling/assign/pendingSecond': ExamineComponent
'/memberCenter/handling/assign/pendingFirst/detail': ExamineComponent,
'/memberCenter/handling/assign/pendingSecond/detail': ExamineComponent,
'/memberCenter/handling/confirm/pendingSubmit/detail': ExamineComponent,
'/memberCenter/handling/confirm/pendingFirst/detail': ExamineComponent,
'/memberCenter/handling/confirm/pendingSecond/detail': ExamineComponent,
'/memberCenter/handling/confirm/pendingConfirm/detail': ExamineComponent
}
return (Component_MAP[pathname] || null)
return (COMPONENT_MAP[pathname] || null)
}
return (
......@@ -176,7 +240,12 @@ const Detail: React.FC<{}> = () => {
deliveryAddress={info.deliveryAddress}
deliveryUserName={info.deliveryUserName}
deliveryUserTel={info.deliveryUserTel}
editDeliverAddress={isSetDeliverAddress}
activeAddress={activeAddress}
deliverAddressOption={deliverAddressOption}
deliverAddressOnChange={deliverAddressOnChange}
/>
</div>
<div style={{marginTop: '20px'}}>
<Row justify="space-between">
......
import React, { useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Select, DatePicker, Input, InputNumber } from 'antd';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import createProcessStockSchema from '../../schema/createProcessStockSchema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import SelectGoods from '../../components/SelectGoods'
import {WrapUploadFile} from '../../components/UploadFile';
/*
* @Author: Bill
* @Date: 2020-10-12 11:36:38
* @Description: 新增加工入库单
*/
const formActions = createFormActions();
const createProcessStock: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
// 选择货品
const [modalProducVisible, setModalProductVisible] = useState<boolean>(false);
const tableAddButton = (
<div>
<Button
onClick={() => setModalProductVisible(true)}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
新建单据明细
</Button>
</div>
)
/**单据明细 */
const docDetailColumn = () => {
return [
{ title: '货号', dataIndex: 'no' },
{ title: '货品名称', dataIndex: 'name' },
{ title: '规格/size', dataIndex: 'size' },
{ title: '品类', dataIndex: 'category' },
{ title: '品牌', dataIndex: 'brand' },
{ title: '单位', dataIndex: 'unit' },
{ title: '成本价', dataIndex: 'cost' },
{
title: '加工商品名称',
dataIndex: 'productName',
render: (text, record) => {
const options = [{
lable: 'test',
value: 1
}]
return <Select options={options}></Select>
}
},
{ title: '商品ID', dataIndex: 'productId' },
{ title: '订单号', dataIndex: 'orderId' },
{ title: '单价', dataIndex: 'unitPrice' },
{
title: '入库数量',
dataIndex: 'total',
render: (text, reocrd) => {
return (
<InputNumber />
)
} },
{ title: '入库金额', dataIndex: 'price' },
{ title: '操作', render: (text, record) => (<a>删除</a>)}
];
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title="新建加工入库单"
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>,
]}
>
<Card>
<NiceForm
schema={createProcessStockSchema}
actions={formActions}
components={{WrapUploadFile, DatePicker, Select}}
expressionScope={{
tableAddButton,
tableColumns: docDetailColumn()
}}
/>
{/* 加工商品Modal框 */}
<SelectGoods
visible={modalProducVisible}
cancel={() => setModalProductVisible(false)}
></SelectGoods>
</Card>
</PageHeaderWrapper>
)
}
export default createProcessStock
......@@ -12,8 +12,11 @@ import { schema } from './schema';
import moment from 'moment';
import { ColumnsType } from 'antd/es/table';
import { timeRange } from '@/utils';
import { Link, history } from 'umi'
const formActions = createFormActions();
const ADD_PROCESS_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
const ADD_DELIVERY_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add'
const columns: ColumnsType = [
{
......@@ -37,7 +40,7 @@ const columns: ColumnsType = [
},
{ title: '发货批次', dataIndex: 'deliveryBatch'},
{
title: '发货单号',
title: '入库单号',
dataIndex: 'storageNo',
render: (text) => {
return (
......@@ -50,15 +53,29 @@ const columns: ColumnsType = [
{
title: '操作',
dataIndex: 'action',
render: (text, record) => {
return <a>审核加工入库单</a>
render: (text, record: any) => {
// 这里暂时不知道status的状态, 先用内部状态判断, 审核的先不处理, 感觉应该用入库单号去判断吧
const MAP = {
'待新增加工发货单': <Link to={ADD_PROCESS_PATH}>新增加工发货单</Link>,
'待审核加工发货单': <a>待审核加工发货单</a>,
'新增加工入库单': <Link to={ADD_DELIVERY_PATH}>新增加工入库单</Link>,
'审核加工入库单': <a>审核加工入库单</a>
}
return MAP[record.innerStatusName]
}
}
]
const SERVICE_MAPS = {
///enhance/process/toBeAddDelivery/list
'/memberCenter/handling/assign/pendingAddProcessing': PublicApi.getEnhanceSupplierToBeAddStorageList,
'/memberCenter/handling/confirm/processingInvoiceTobeAdd': PublicApi.getEnhanceProcessToBeAddDeliveryList,
}
const processStock: React.FC<{}> = () => {
const ref = useRef<any>({});
const pathname = history.location.pathname;
const fetchData = useCallback(async (params: any) => {
const { docTime, ...rest } = params;
const {st, et} = timeRange(docTime);
......@@ -67,9 +84,9 @@ const processStock: React.FC<{}> = () => {
endTime: et,
...rest
}
const res = await PublicApi.getEnhanceSupplierToBeAddStorageList(postData)
const res = await SERVICE_MAPS[pathname](postData)
return res.data;
}, []);
}, [pathname]);
return (
......@@ -89,7 +106,7 @@ const processStock: React.FC<{}> = () => {
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'search',FORM_FILTER_PATH);
useStateFilterSearchLinkageEffect($,actions,'noticeNo',FORM_FILTER_PATH);
}}
schema={schema}
/>
......
......@@ -13,13 +13,13 @@ export const schema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
noticeNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号1进行搜索',
tip: '输入通知单号进行搜索',
},
},
[FORM_FILTER_PATH]: {
......
import React from 'react';
import { Card, Col, Row } from 'antd'
import React, { useState, useEffect } from 'react';
import { Card, Col, Row, Select } from 'antd'
import { PublicApi } from '@/services/api';
const Option = Select.Option;
enum deliveryType {
logistics,
......@@ -14,10 +17,15 @@ interface Iprops {
receiveUserTel: string
deliveryAddress: string,
deliveryUserName: string,
deliveryUserTel: string
deliveryUserTel: string,
editDeliverAddress: boolean,
deliverAddressOnChange: (value: string) => void,
activeAddress: string,
deliverAddressOption: {label: string, value: string}[]
}
const DeliveryInfomation: React.FC<Iprops> = (props) => {
return (
<Card title="交付信息">
<Row>
......@@ -41,16 +49,38 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
<Col offset={5}>{props.receiveAddress}</Col>
</Row>
</Col>
{
props.editDeliverAddress
? <Col span={9}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>发货地址</Col>
<Col span={19}>
<Select style={{width: '100%'}} value={props.activeAddress}>
{
props.deliverAddressOption.map((item) => {
return (
<Option key={item.value} value={item.value}>
{item.label}
</Option>
)
})
}
{/* <Option value={"1"}>test</Option> */}
</Select>
</Col>
</Row>
</Col>
: <Col span={9} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>发货地址</Col>
<Col>{props.deliveryUserTel} / {props.deliveryUserName}</Col>
</Row>
<Row>
<Col offset={5}>{props.deliveryAddress}</Col>
</Row>
</Col>
}
<Col span={9} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>发货地址</Col>
<Col>{props.deliveryUserTel} / {props.deliveryUserName}</Col>
</Row>
<Row>
<Col offset={5}>{props.deliveryAddress}</Col>
</Row>
</Col>
</Row>
</Card>
)
......
......@@ -3,7 +3,7 @@
* @description 加工通用列表页列表页, 用于 ["生产通知单","待生产通知单","待审核生产通知单(一级)", ""]等
*/
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button, Menu, Dropdown, Badge } from 'antd';
import NiceForm from '@/components/NiceForm';
......@@ -63,6 +63,7 @@ const Query: React.FC<{}> = (props) => {
const ref = useRef<any>({});
const { lastTypeParams } = usePageStatus();
const [selectRow, selectRowFns] = useRowSelectionTable({ customKey: 'id' });
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const fetchData = async (params: any) => {
const service = SERVICES[lastTypeParams];
......@@ -229,10 +230,13 @@ const Query: React.FC<{}> = (props) => {
}
let {params, service} = getParamsAndService[lastTypeParams]();
if(service) {
setSubmitLoading(true)
service(params).then(({data, code}) => {
if(code === 1000) {
formActions.submit();
}
}).finally(() => {
setSubmitLoading(false)
})
}
}
......@@ -265,10 +269,13 @@ const Query: React.FC<{}> = (props) => {
}
let {params, service} = getParamsAndService[lastTypeParams]();
if(service) {
setSubmitLoading(true)
service(params).then(({data, code}) => {
if(code === 1000) {
formActions.submit();
}
}).finally(() => {
setSubmitLoading(false);
})
}
}
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
/*
* @Author: Bill
* @Date: 2020-10-12 10:46:36
* @LastEditTime: 2020-10-15 13:54:07
* @Description: 指派生产通知单查询页 schema
*/
const schema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
desc: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号、通知单摘要进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
name: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '加工企业名称(全部)',
allowClear: true,
},
},
time: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export default schema
\ No newline at end of file
/*
* @Author: your name
* @Date: 2020-10-15 16:30:26
* @Description: 新增加工入库单 Schema
*/
const basicTab = {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
'tab': '基本信息'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left'
},
properties: {
type: {
title: '单据类型',
type: 'string',
enum: [],
'x-rules': [
{
required: true, // 自定义校验规则
message: '请选择单据类型'
}
],
},
warehouse: {
type: 'string',
title: '对应仓库',
enum: [],
"x-rules": [
{
required: true,
message: '请选择对应仓库'
}
],
},
desc: {
type: 'string',
title: '单据摘要',
"x-rules": [
{
required: true,
message: '请填写单据摘要'
},
{
limitByte: true, // 自定义校验规则
maxByte: 60
}
]
},
time: {
type: 'string',
title: '单据时间',
'x-component': 'DatePicker',
'x-rules': [
{
required: true,
message: '请选择单据时间'
}
]
},
warehousePeople: {
type: 'string',
title: '仓库人员',
'x-rules': [
{
required: true,
message: '请选择单据时间'
}
]
},
correspondingDoc: {
type: 'radio',
title: '对应单据',
required: true,
enum: [
{
label: '生产通知单',
value: 1
}
],
default: 1
},
connectDoc: {
type: 'text',
title: '关联单据'
},
memberName: {
type: 'text',
title: '会员名称'
},
address: {
type: 'text',
title: '收货地址',
},
method: {
type: 'text',
title: '配送方式'
}
}
}
}
}
}
const detailTab = {
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 24,
labelAlign: 'left'
},
properties: {
someLists: {
type: 'array:number',
'x-mega-props': {
wrapperCol: 24,
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'id',
prefix: "{{tableAddButton}}",
columns: "{{tableColumns}}",
}
}
}
}
}
}
}
const createProcessStockSchema = {
type: 'object',
properties: {
'Tabs': {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card'
},
properties: {
...basicTab,
...detailTab,
}
}
}
}
export default createProcessStockSchema
\ No newline at end of file
/*
* @Author: Bill
* @Date: 2020-10-15 14:01:34
* @Description: 待审核生产通知单(一级)
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const schema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
search: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
name: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '加工企业名称(全部)',
allowClear: true,
},
},
time: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export default schema;
\ No newline at end of file
/*
* @Author: Bill
* @Date: 2020-10-14 18:45:31
* @LastEditTime: 2020-10-19 09:56:52
* @desc 选择加工商品schema
* 这里其实就是两个flex 布局加一个table, 通过expressScrope 注入代码
*/
const schema = (others) => {
return {
type: 'object',
properties: {
layout: {
type: 'object',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between',
align: 'center'
},
properties: {
'flex-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexColumnLayout',
properties: {
controllers: {
type: 'object',
name: 'controllers',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start',
},
properties: {
name: {
type: 'string',
name: 'name',
'x-component': 'Search',
'x-component-props': {
placeholder: "请填写标题名称",
"onSearch": "{{search}}",
}
},
'HIGHT_FILTER_BTN': {
type: 'string',
name: 'HIGHT_FILTER_BTN',
'x-component': 'button',
'x-component-props': {
"children": "{{HIGHT_FILTER_BTN}}",
"onClick": "{{toggleFilters}}",
style: {
margin: '0 15px'
}
}
},
reset: {
type: 'string',
name: 'reset',
"x-component": "button",
"x-component-props": {
"onClick": "{{reset}}",
"children": "重置",
}
},
}
},
'FILTERS': {
type: 'object',
name: 'FILTERS',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start'
},
properties: {
columns: {
name: 'columns',
type: 'string',
'x-component': 'Select',
'x-component-props': {
placeholder: '请选择栏目',
style: {
width: '160px'
}
}
},
status: {
name: 'status',
type: 'string',
'x-component': 'Select',
'x-component-props': {
options: [
{label: '全部', value: '0'},
{label: '待上架', value: '1'},
{label: '已上架',value: '2'},
{label: '已下架',value: '3'},
],
placeholder: '请选择状态',
style: {
width: '160px',
margin: '0 15px'
}
}
},
queryBtn: {
type: 'string',
'x-component': 'Submit',
"x-component-props": {
"children": "查询",
}
}
}
}
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
simple: true
}
}
}
},
...others
}
}
}
export default schema
/*
* @Author: Bill
* @Date: 2020-10-15 14:01:34
* @Description: 待新增生产通知单
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const schema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
search: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
name: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '加工企业名称(全部)',
allowClear: true,
},
},
time: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export default schema;
\ No newline at end of file
......@@ -45,7 +45,7 @@ const UserCenter: React.FC<Iprops> = () => {
<div className={styles.content}>
<Row className={styles.row}>
<Col span={11} className={styles.user}>
<div className={styles.pic} style={!userAuth?.logo ? {display: 'none'} : {}}>
<div className={styles.pic} style={!userAuth.logo ? {display: 'none'} : {}}>
<img src={userAuth.logo} />
</div>
<div className={styles.wrapper}>
......
import React, { useState, useEffect, useCallback, useRef } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined, QuestionCircleOutlined } from '@ant-design/icons'
import React, { useState, useEffect } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons'
import Filter from '../components/Filter'
import { FILTER_TYPE } from '@/constants'
import cx from 'classnames'
......@@ -13,7 +13,7 @@ import { store } from '@/store'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import bannerImg from '@/assets/imgs/banner_2.png'
// import bannerImg from '@/assets/imgs/banner_2.png'
import arrowDownIcon from '@/assets/imgs/arrow_down.png'
import arrowDownActiveIcon from '@/assets/imgs/arrow_down_active.png'
import styles from './index.less'
......
......@@ -147,12 +147,13 @@
color: #303133;
text-align: left;
margin-top: 12px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
// display: -webkit-box;
// -webkit-box-orient: vertical;
// -webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient: vertical;
white-space: nowrap;
// -webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
......
import React from 'react'
import noResultIcon from '@/assets/imgs/no_result_icon.png'
import styles from './index.less'
interface ErrorResultPropsType {
errorMessage: string
}
const ErrorResult: React.FC<ErrorResultPropsType> = (props) => {
const { errorMessage } = props
return (
<div className={styles.no_result_container}>
<div className={styles.no_result}>
<div className={styles.no_result_tip}>
<div className={styles.no_result_tip_img}>
<img src={noResultIcon} />
</div>
<div className={styles.no_result_tip_text}>
{ errorMessage }
</div>
</div>
<div className={styles.no_result_suggest}>
<ul className={styles.no_result_suggest_list}>
<li>出现的可能原因:</li>
<li>1、管理员冻结了该商品</li>
<li>2、商品链接出现错误</li>
</ul>
</div>
</div>
</div>
)
}
export default ErrorResult
\ No newline at end of file
......@@ -362,4 +362,58 @@
color: #FFF;
}
}
}
.no_result_container {
width: 1200px;
margin: 0 auto;
}
.no_result {
width: 300px;
margin: 0 auto;
padding: 200px 0;
&_tip {
font-size: 14px;
color: #D32F2F;
font-weight: 500;
display: flex;
&_text {
line-height: 30px;
}
&_search {
color: #303133;
}
&_img {
width: 30px;
height: 30px;
overflow: hidden;
margin-right: 16px;
&>img {
width: 30px;
height: 30px;
}
}
}
&_suggest {
margin-top: 12px;
font-size: 12px;
color: #909399;
padding-left: 46px;
&_list {
padding: 0;
margin: 0;
&>li {
list-style: none;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -30,7 +30,7 @@ const PopularShops: React.FC<PopularShopsPropsType> = (props) => {
<div className={styles.popular_shops_list}>
{
shopList && shopList.map((item, index) => index <=5 && (
<div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_list_item} key={item.memberShopId}>
<div className={styles.popular_shops_rank}>0{index+1}</div>
<div className={styles.popular_shops_logo}>
<ImageBox width={36} height={36} imgUrl={item.memberLogo} />
......
......@@ -48,7 +48,7 @@ const ShoppingNews: React.FC = () => {
</div>
<div className={styles.popular_buy_dynamic_list_item_content}>
<span className={styles.content_text}>{item.count || 0}条回应</span>
<span className={styles.content_time}>{moment(item.deliveryTime).format("MM/DD HH:mm")}</span>
<span className={styles.content_time}>{moment(item.deliveryTime || "").format("MM/DD HH:mm")}</span>
</div>
</div>
))
......
......@@ -172,13 +172,13 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
let link = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
link = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
link = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ memberId }))}`
break
case LAYOUT_TYPE.ichannel:
link = `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
link = `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ memberId }))}`
break
default:
link = `/shop/commodity/detail?id=${item.id}&shopId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
link = `/shop/commodity/detail?id=${item.id}&shopId=${btoa(JSON.stringify({ memberId }))}`
break
}
return link
......
......@@ -195,6 +195,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
if (orderItem.logistics?.deliveryType === 1 && orderItem.logistics?.carriageType === 2 && orderItem.logistics?.useTemplate && templateId) {
orderProductList.push({
templateId,
count: orderItem.count,
weight: orderItem.logistics?.weight,
})
}
......
......@@ -36,18 +36,19 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
}
useEffect(() => {
if (orderInfo) {
if (orderInfo && payInfo) {
fetchBalanceInfo()
fetchSecurity()
}
}, [orderInfo])
}, [orderInfo, payInfo])
const fetchBalanceInfo = () => {
let param = {
payType: orderInfo.ruleConfigurationId,
payType: payInfo.ruleConfigurationId,
parentMemberId: orderInfo.supplyMembersId,
parentMemberRoleId: orderInfo.supplyMembersRoleId
}
//@ts-ignore
PublicApi.getPayAssetAccountGetUserBalance(param).then(res => {
if (res.code === 1000) {
setBalanceInfo(res.data)
......
......@@ -8,6 +8,7 @@ import {
} from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { setAuth, setRouters } from '@/utils/auth';
import { encryptedByAES } from '@/utils/cryptoAes';
const LoginWrap: React.FC = () => {
const { redirect } = history.location.query
......@@ -16,6 +17,7 @@ const LoginWrap: React.FC = () => {
const [loginLoading, setLoginLoading] = useState<boolean>(false)
const finish = (value: any) => {
value.password = encryptedByAES(value.password)
setLoginLoading(true)
PublicApi.postMemberLogin(value).then(res => {
const { data, code } = res
......
......@@ -11,6 +11,7 @@ import { PATTERN_MAPS } from '@/constants/regExp';
import { omit } from '@/utils';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { encryptedByAES } from '@/utils/cryptoAes';
const actions = createFormActions()
......@@ -21,6 +22,7 @@ const GetBack: React.FC = () => {
const { account } = value
const isEmail = PATTERN_MAPS.email.test(account)
const accountParams = isEmail ? {email: account, ...omit(value, ['account', 'confirmPassword'])} : { phone: account, ...omit(value, ['account', 'confirmPassword']) }
accountParams.password = encryptedByAES(accountParams.password)
const submitFn = isEmail ? PublicApi.postMemberRegisterResetEmail : PublicApi.postMemberRegisterResetSms
const { code } = await submitFn(accountParams)
......
......@@ -15,6 +15,7 @@ import { omit, transFormSchema, filterUndef } from '@/utils';
import { PublicApi } from '@/services/api';
import NiceForm from '@/components/NiceForm';
import schemas from './schema';
import { encryptedByAES } from '@/utils/cryptoAes';
const { onFieldValueChange$, onFieldInputChange$, onFieldValidateEnd$ } = FormEffectHooks
......@@ -235,6 +236,7 @@ const UserRegistry = () => {
// 写死传入的区号
formCache.countryCode = prefixCode
const params = omit(formCache, ['isRead', 'confirmPassword'])
params.password = encryptedByAES(params.password)
setSubmitLoading(true)
PublicApi.postMemberRegister(params).then(({ code }) => {
if (code === 1000) {
......
import CryptoJS from 'crypto-js'
var key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0');
// var iv = CryptoJS.enc.Utf8.parse('JlM6cyqmrC2zKNsx');
/**
* @auth xjm
* 加密方法
*/
export const encryptedByAES = (source: string) => {
var password=CryptoJS.enc.Utf8.parse(source);
var encrypted = CryptoJS.AES.encrypt(password, key, {mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}); //CryptoJS.pad.Pkcs7
return encrypted.toString() // 加密后的base64
}
/**
* @auth xjm
* 解密方法
*/
export const decryptedByAES = (source: string) => {
var decrypted = CryptoJS.AES.decrypt(source, key, {mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}); //CryptoJS.pad.Pkcs7
return decrypted.toString(CryptoJS.enc.Utf8) // 解密后的原始字符串
}
\ No newline at end of file
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