Commit 8050f861 authored by XieZhiXiong's avatar XieZhiXiong
parents eb8c46f6 0d99cc6c
......@@ -49,8 +49,28 @@ const config: any = {
defaultSizes: 'parsed', // stat // gzip
},
inlineLimit: 10000,
// 自定义修改webpack配置
chainWebpack(memo, { env, webpack, createCSSRule }) {
chunks: ['vendors', 'umi'],
chainWebpack: function (config, { webpack }) {
config.merge({
optimization: {
minimize: true,
splitChunks: {
chunks: 'all',
minSize: 30000,
minChunks: 3,
automaticNameDelimiter: '.',
cacheGroups: {
vendor: {
name: 'vendors',
test({ resource }) {
return /[\\/]node_modules[\\/]/.test(resource);
},
priority: 10,
},
},
},
}
});
},
cssLoader: {
localsConvention: 'camelCase', // 将style中的class由 .foo-body 转化为fooBody调用
......
......@@ -110,7 +110,7 @@ const HandlingRoute = {
path: '/memberCenter/handling/assign/pendingReceive',
name: 'toBeRecieve',
icon: 'smile',
component: '@/pages/handling/components/Query'
component: '@/pages/handling/assign/processStock'
},
// 指派生产通知单 -> 待收货生产通知单
{
......@@ -214,6 +214,15 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/assign/processStock',
},
// 待确认生产通知单 -> 待新增加工发货单详情
{
path: '/memberCenter/handling/confirm/processingInvoiceTobeAdd/detail',
name: 'processingInvoiceTobeAddDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 确认生产通知单 -> 新建加工发货单
// {
// path: '/memberCenter/handling/confirm/createProcessInvoice',
......
// 这里的env只有对本地起效, 线上构建不用
const path = require('path')
module.exports = {
scm: {
SITE_ID: '1',
BACK_GATEWAY: 'http://lingxi-scm.wg.shushangyun.com',
USE_ROUTE_CONFIG: false,
SOCKET_URL: 'ws://lingxi-scm.wg.shushangyun.com',
ssh: JSON.stringify({
user: "www",
// Password optional, prompted if none given
password: "!@#project_$%^231(1)wwwuser3",
host: "119.23.219.65",
port: 8122,
localRoot: path.resolve('./dist/'),
remoteRoot: "/usr/local/nginx/html/lingxi/yanshi/api/scm/web/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true
deleteRemote: true,
// Passive mode is forced (EPSV command is not sent)
forcePasv: true
})
},
10: {
SITE_ID: '1',
BACK_GATEWAY: 'http://10.0.0.10:8100',
USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://10.0.0.10:8100',
ssh: JSON.stringify({
user: "root",
// Password optional, prompted if none given
password: "123456",
host: "10.0.0.10",
port: 22,
localRoot: path.resolve('./dist/'),
remoteRoot: "/home/www/lingxi/lingxi-business-platform/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true
deleteRemote: true,
// Passive mode is forced (EPSV command is not sent)
forcePasv: true
})
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@
"name": "lingxi-business-paltform",
"version": "1.0.4",
"scripts": {
"upload:scm": "cross-env local=scm taskName=upload yarn scripts:build",
"upload:10": "cross-env local=10 taskName=upload yarn scripts:build",
"api": "god-ytt",
"scripts:build": "node scripts/run",
"scripts:build-yxc": "node scripts/run http://yxc-web-demo.shushangyun.com/api",
......@@ -14,6 +16,8 @@
"build:analyze": "NODE_OPTIONS=--max_old_space_size=4096 ANALYZE=1 umi build",
"build:dev": "pm2 start scripts/devServer.js",
"build:clean": "NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn build",
"build:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.10:8100 yarn build",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
......@@ -77,17 +81,26 @@
},
"devDependencies": {
"@types/qrcode": "^1.3.4",
"async": "^3.2.0",
"axios": "^0.19.2",
"chalk": "^4.1.0",
"clone": "^2.1.2",
"connect-history-api-fallback": "^1.6.0",
"cross-env": "^7.0.2",
"events": "^3.2.0",
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"god-upload-scp": "^1.2.0",
"god-yapi2ts": "^1.6.0",
"gulp": "^4.0.2",
"gulp-git": "^2.10.1",
"http-proxy-middleware": "^1.0.5",
"json2ts": "^0.0.7",
"ora": "^4.0.4"
"node-cmd": "^4.0.0",
"ora": "^4.0.4",
"scp2": "^0.1.0-b1",
"ssh2": "^0.8.9",
"util": "^0.12.3"
}
}
/**
* 手动上传文件
* @auth xjm
*/
const git = require('gulp-git')
const Logs = require('./utils/log')
const cmd = require('node-cmd')
const scpRun = require('god-upload-scp')
/**
* 获取远程代码
*/
// const pullRemoteCode = (done) => {
// git.pull('origin', ['dev', 'test'], function(err) {
// if (err) {
// throw err
// }
// Logs.stop('pull code success!', 'success')
// // installPackage(done)
// connectSSH(done)
// })
// }
// const installPackage = (done) => {
// Logs.start('start install package')
// cmd.run('yarn', function(err) {
// if (err) {
// throw err
// }
// Logs.stop('install package success!', 'success')
// runBuild(done)
// })
// }
const runBuild = (done) => {
Logs.start('构建开始, 这里时间有点长...')
cmd.run(`yarn build:${process.env.local}`, function(err) {
if (err) {
throw err
}
Logs.stop('构建终于成功了!', 'success')
connectSSH(done)
})
}
const connectSSH = (done) => {
const sshInfo = JSON.parse(process.env.ssh)
scpRun(sshInfo, process.env.local, done)
}
const initUpload = (done) => {
Logs.stop('开始上传到远程服务器!', 'success')
connectSSH(done)
}
module.exports = {
initUpload
}
\ No newline at end of file
......@@ -7,18 +7,24 @@ const runFile = './services'
const fetchConfig = require(runFile).fetchConfig
const gulp = require('gulp')
const json2ts = require('json2ts')
const uploadBuildStram = require('./build')
const rootPath = '../';
const outputPath = path.resolve(__dirname, rootPath, 'config/base.config.json')
const outputDts = path.resolve(__dirname, rootPath, 'src/global/config/global.d.ts')
Logs.start('gulp start')
// Logs.start('gulp start')
gulp.task('start', gulp.series(done => {
getAsyncConfig(done)
}))
gulp.task('upload', gulp.series(done => {
Logs.start('use upload')
uploadBuildStram.initUpload(done)
}))
/**
* 生成对应json文件
*/
......
const gulp = require('gulp')
const envValue = require('../env')
// @todo
const taskName = process.env.taskName || 'start'
// 本地构建时带上的环境变量
const local = process.env.local
if (local) {
process.env.SITE_ID = envValue[local].SITE_ID
process.env.BACK_GATEWAY = envValue[local].BACK_GATEWAY
process.env.USE_ROUTE_CONFIG = envValue[local].USE_ROUTE_CONFIG
process.env.SOCKET_URL = envValue[local].SOCKET_URL
process.env.ssh = envValue[local].ssh
}
function runTask(toRun) {
const metadata = { task: toRun };
......@@ -23,4 +37,4 @@ function runTask(toRun) {
}
require('./gulpfile')
runTask('start')
\ No newline at end of file
runTask(taskName)
\ No newline at end of file
......@@ -12,8 +12,9 @@ const Logs = {
log(chalk.red(msg))
},
start() {
spinner.start()
start(msg) {
spinner.start(msg)
return spinner
},
stop(msg, type) {
......
import { IRoutes } from '.';
import { history, RequestConfig, Redirect } from 'umi';
import { history, Redirect } from 'umi';
import React from 'react'
import MobxProvider from './store'
import '@/global/styles/reset.less'; // 重置antd样式
......
......@@ -482,6 +482,7 @@ export default {
'menu.handling.confirm.pendingConfirm': '待确认生产通知单',
'menu.handling.confirm.pendingConfirmDetail': '待确认生产通知单详情',
'menu.handling.confirm.processingInvoiceTobeAdd': '待新增加工发货单',
'menu.handling.confirm.processingInvoiceTobeAddDetail': '待新增加工发货单详情',
'menu.handling.confirm.pendingAddLogistics': '待新增物流单',
'menu.handling.confirm.pendingDelivered': '待发货生产通知单',
'menu.handling.confirm.pendingReceipt': '待确认回单生产通知单',
......
......@@ -218,4 +218,39 @@ export const receiveColumns: ColumnsType = [
title: '未发货',
dataIndex: 'notDeliverNum'
}
];
\ No newline at end of file
];
export const pnoReceiveDeliverDetailDOListColumns = [
{
title: '订单号',
dataIndex: 'orderNo'
},
{
title: 'ID',
dataIndex: 'orderId'
},
{
title: '商品名称',
dataIndex: 'productName'
},
{
title: '品类',
dataIndex: 'category'
},
{
title: '品牌',
dataIndex: 'brand'
},
{
title: '单位',
dataIndex: 'unit'
},
{
title: '加工数量',
dataIndex: 'processNum'
},
{
title: '发货数量',
dataIndex: 'deliverNum'
}
]
\ No newline at end of file
......@@ -2,7 +2,7 @@ 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, Badge } from 'antd';
import { PageHeader, Descriptions, Card, Tabs, Row, Col, Button, Badge, Table } from 'antd';
import Circulation from '../../components/Circulation';
import WrapTable from '../../components/WrapTable';
import OtherRequirement from '../../components/OtherRequirement';
......@@ -11,8 +11,9 @@ import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api';
import StatusTag from '@/components/StatusTag';
import DeliveryInfomation from '../../components/DeliveryInformation';
import ReceiptDeliveryDetails from '../../components/ReceiptDeliveryDetails';
import moment from 'moment';
import { columns, orderDetailColumn, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn, receiveColumns } from './columns';
import { columns, orderDetailColumn, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn, receiveColumns, pnoReceiveDeliverDetailDOListColumns } from './columns';
import ExamineModal from '../../components/ExamineModal';
import { FormOutlined } from '@ant-design/icons'
import {
......@@ -44,14 +45,16 @@ const SERVICE_MAP = {
[`${CONFIRM_PENDING_SUBMIT_DETAIL}`]: PublicApi.getEnhanceProcessToBeSubmitExamDetails,
[`${CONFIRM_PENDING_FIRST_DETAIL}`]: PublicApi.getEnhanceProcessToBeFirstExamDetails,
[`${CONFIRM_PENDING_SECOND_DETAIL}`]: PublicApi.getEnhanceProcessToBeSecondExamDetails,
[`${CONFIRM_PENDING_CONFIRM_DETAIL}`]: PublicApi.getEnhanceProcessToBeConfirmDetails
[`${CONFIRM_PENDING_CONFIRM_DETAIL}`]: PublicApi.getEnhanceProcessToBeConfirmDetails,
'/memberCenter/handling/confirm/processingInvoiceTobeAdd/detail': PublicApi.getEnhanceProcessToBeAddDeliveryDetails,
}
/**
* 审核链接
*/
const EXAM_SERVICE = {
[`${ASSIGN_QUERY_DETAIL}`]: PublicApi.postEnhanceSupplierToBeFirstExamExam,
[`${ASSIGN_QUERY_DETAIL}`]: PublicApi.postEnhanceSupplierToBeAddSubmitExam,
[`${ASSIGN_PENDING_FIRST_DETAIL}`]: PublicApi.postEnhanceSupplierToBeFirstExamExam,
[`${ASSIGN_PENDING_SECOND_DETAIL}`]: PublicApi.postEnhanceSupplierToBeSecondExamExam,
[`${CONFIRM_PENDING_SUBMIT_DETAIL}`]: PublicApi.postEnhanceProcessToBeSubmitExamExam,
[`${CONFIRM_PENDING_FIRST_DETAIL}`]: PublicApi.postEnhanceProcessToBeFirstExamExam,
......@@ -239,21 +242,17 @@ const Detail: React.FC<{}> = () => {
<div style={{marginTop: '20px'}}>
<Card>
<h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1>
<WrapTable dataSource={info?.details} columns={info.source === 2 ? orderDetailColumn : columns}/>
<Table rowKey={"id"} dataSource={info?.details} columns={info.source === 2 ? orderDetailColumn : columns}/>
</Card>
</div>
<div style={{marginTop: '20px', display: info.pnoReceiveDeliverDetailDOList?.length > 0 ? 'block' : 'none'}}>
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs>
<TabPane tab="收发货统计" key="1">
<WrapTable columns={receiveColumns} dataSource={info?.details} />
</TabPane>
<TabPane tab="收发货明细" key="2">
<WrapTable dataSource={[]} />
</TabPane>
</Tabs>
</Card>
<ReceiptDeliveryDetails
statisticsColumn={receiveColumns}
statisticsData={info.details}
pnoReceiveDeliverDetailDOList={info.pnoReceiveDeliverDetailDOList}
pnoReceiveDeliverDetailColumns={pnoReceiveDeliverDetailDOListColumns}
/>
</div>
<div style={{marginTop: '20px'}}>
<DeliveryInfomation
......
import React, { useRef, useCallback } from 'react';
import React, { useRef, useCallback, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import { Card, Space, Button, Popconfirm } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
......@@ -18,76 +18,38 @@ import { DOC_TYPE_PROCESS_INVOICE, DEPENDENT_DOC_PRODUCTION } from '@/constants'
const formActions = createFormActions();
const ADD_PROCESS_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
const ADD_DELIVERY_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
const ADD_LOGISTICS_PATH = '/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add';
const TITLE = {
'/memberCenter/handling/assign/pendingAddProcessing': "待新建加工入库单",
'/memberCenter/handling/confirm/processingInvoiceTobeAdd': "待新增加工发货单",
'/memberCenter/handling/confirm/pendingAddLogistics': "待新增物流单",
'/memberCenter/handling/confirm/pendingDelivered': "待发货生产通知单",
'/memberCenter/handling/confirm/pendingReceipt': "待确认回单生产通知单"
'/memberCenter/handling/confirm/pendingReceipt': "待确认回单生产通知单",
'/memberCenter/handling/assign/pendingReceive': "待确认收货生产通知单",
}
const columns: ColumnsType = [
{
title: '通知单号',
dataIndex: 'noticeNo',
render: (text) => {
return (
<EyePreview url={"/memberCenter/handling/assign/query"} >{text}</EyePreview>
)
}
},
{ title: '通知单摘要', dataIndex: 'summary'},
{ title: '加工企业名称', dataIndex: 'processName' },
{ title: '供应会员', dataIndex: 'supplierName'},
{
title: '单据时间',
dataIndex: 'createTime',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
}
},
{ title: '发货批次', dataIndex: 'deliveryBatch'},
{
title: '入库单号',
dataIndex: 'storageNo',
render: (text) => {
return (
<EyePreview url="/" >{text}</EyePreview>
)
}
},
{ title: '外部状态', dataIndex: 'outerStatusName'},
{ title: '内部状态', dataIndex: 'innerStatusName'},
{
title: '操作',
dataIndex: 'action',
render: (text, record: any) => {
// 这里暂时不知道status的状态, 先用内部状态判断, 审核的先不处理, 感觉应该用入库单号去判断吧
const MAP = {
'待新增加工发货单': <Link to={`${ADD_PROCESS_PATH}?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PROCESS_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_PRODUCTION}
`}>新增加工发货单</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,
'/memberCenter/handling/confirm/pendingAddLogistics': PublicApi.getEnhanceProcessToBeAddLogisticsList,
'/memberCenter/handling/confirm/pendingDelivered': PublicApi.getEnhanceSupplierToBeReceiveList,
'/memberCenter/handling/confirm/pendingReceipt': PublicApi.getEnhanceProcessToBeConfirmReceiptList
'/memberCenter/handling/confirm/pendingReceipt': PublicApi.getEnhanceProcessToBeConfirmReceiptList,
'/memberCenter/handling/assign/pendingReceive': PublicApi.getEnhanceSupplierToBeReceiveList
}
enum ExamType {
delivery = "deliver", //加工发货单
warehouseReceipt = 'warehouseReceipt', // 加工入库单
}
const processStock: React.FC<{}> = () => {
const ref = useRef<any>({});
const pathname = history.location.pathname;
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const [visibleID, setVisibleID] = useState<null|number>(null);
const fetchData = useCallback(async (params: any) => {
const { docTime, ...rest } = params;
const {st, et} = timeRange(docTime);
......@@ -100,6 +62,146 @@ const processStock: React.FC<{}> = () => {
return res.data;
}, [pathname]);
const columns: ColumnsType = [
{
title: '通知单号',
dataIndex: 'noticeNo',
render: (text, record: any) => {
return (
<EyePreview url={`${pathname}/detail?id=${record.id}`} >{text}</EyePreview>
)
}
},
{ title: '通知单摘要', dataIndex: 'summary'},
{ title: '加工企业名称', dataIndex: 'processName' },
{ title: '供应会员', dataIndex: 'supplierName'},
{
title: '单据时间',
dataIndex: 'createTime',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
}
},
{ title: '发货批次', dataIndex: 'deliveryBatch'},
{
title: '入库单号',
dataIndex: 'deliveryNo',
render: (text) => {
if(!text) {
return null
}
return (
<EyePreview url="/" >{text}</EyePreview>
)
}
},
{ title: '外部状态', dataIndex: 'outerStatusName'},
{ title: '内部状态', dataIndex: 'innerStatusName'},
{
title: '操作',
dataIndex: 'action',
render: (text, record: any) => {
// 这里暂时不知道status的状态, 先用内部状态判断, 审核的先不处理, 感觉应该用入库单号去判断吧
const MAP = {
'待新增加工发货单': (
<Link
to={`${ADD_PROCESS_PATH}?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PROCESS_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_PRODUCTION}`}
>
新增加工发货单
</Link>
),
'待审核加工发货单': (
<Popconfirm
title={`是否确认审核发货单号为${record.deliveryNo}的加工发货单?`}
visible={visibleID === record.id}
placement="left"
okText="确定"
cancelText="取消"
onCancel={handleCancel}
okButtonProps={{ loading: confirmLoading }}
onConfirm={() => handleExamDelivery(record.id, ExamType.delivery)}
>
<a onClick={() => handleVisible(record.id)}>审核</a>
</Popconfirm>
),
'新增加工入库单': <Link to={ADD_DELIVERY_PATH}>新增加工入库单</Link>,
'审核加工入库单': (
<Popconfirm
title={`是否确认审核入库单号为${record.deliveryNo}的加工入库单?`}
visible={visibleID === record.id}
placement="left"
okText="确定"
cancelText="取消"
onCancel={handleCancel}
okButtonProps={{ loading: confirmLoading }}
onConfirm={() => handleExamDelivery(record.id, ExamType.warehouseReceipt)}
>
<a onClick={() => handleVisible(record.id)}>审核</a>
</Popconfirm>
),
'待新增物流单': <Link to={`${ADD_LOGISTICS_PATH}`}>新增</Link>,
'待确认物流单': <a>查看</a>,
'待收货通知单': <Link to={'/memberCenter/handling/assign/pendingReceive/detail'}>收货</Link>
}
return MAP[record.innerStatusName]
}
}
]
/**
* 审核加工发货单
* /enhance/process/toBeAddDelivery/exam 待新增发货单
* /enhance/supplier/toBeAddStorage/exam 待新增入库单
* @param id 审核单id
* @param type deliver | warehouseReceipt
*/
const handleExamDelivery = (id: number, type: string) => {
const exam_service = {
[ExamType.delivery]: PublicApi.postEnhanceProcessToBeAddDeliveryExam,
[ExamType.warehouseReceipt]: PublicApi.postEnhanceSupplierToBeAddStorageExam,
}
console.log(type);
setConfirmLoading(true)
exam_service[type]({id})
.then(({code, data}) => {
setConfirmLoading(false);
setVisibleID(null)
if(code === 1000) {
formActions.submit();
}
})
}
/**
* 查询
* @params values 表单字段
*/
const handleSearch = useCallback((values: any) => {
const {docTime, ...rest} = values;
const {st, et} = timeRange(docTime);
let searchData = {
...rest,
startTime: st,
endTtime: et
}
console.log(searchData)
ref.current.reload(searchData)
}, [ref])
/**
* Popconfirm Visible 单一原则
*/
const handleVisible = (id:number) => {
setVisibleID(id)
}
/**
* Popconfirm Cancel
*/
const handleCancel = () => {
setVisibleID(null);
}
return (
<PageHeaderWrapper
......@@ -108,7 +210,7 @@ const processStock: React.FC<{}> = () => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
......@@ -116,7 +218,7 @@ const processStock: React.FC<{}> = () => {
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'noticeNo',FORM_FILTER_PATH);
}}
......
......@@ -158,7 +158,7 @@ export const FILTER_NAMES = {
export const DETAIL_PATH = {
[QUERY_PATH]: ASSIGN_QUERY_DETAIL,
[TO_BE_ADD_QUERY_PATH]: ASSIGN_TO_BE_ADD_QUERY_DETAIL,
[PENDING_FIRST]: CONFIRM_PENDING_FIRST_DETAIL,
[PENDING_FIRST]: ASSIGN_PENDING_FIRST_DETAIL,
[PENDING_SECOND]: ASSIGN_PENDING_SECOND_DETAIL,
[PENDING_SUBMIT]: ASSIGN_PENDING_SUBMIT,
[PENDING_RECEIVE]: ASSIGN_PENDING_RECEIVE_DETAIL,
......
......@@ -29,7 +29,7 @@ const Circulation: React.FC<Iprops> = (props) => {
<TabPane tab="外部流转" key="1">
<Steps progressDot={customDot} style={{marginTop: '20px'}}>
{
outerTaskList.map((item: Istatus) => {
outerTaskList && outerTaskList.map((item: Istatus) => {
return (
<Step title={item.taskName} status={item.isExecute == 1 ? 'finish' : 'wait'} description={item.roleName} key={item.step} />
)
......@@ -41,7 +41,7 @@ const Circulation: React.FC<Iprops> = (props) => {
<TabPane tab="内部流转" key="2">
<Steps progressDot={customDot} style={{marginTop: '20px'}}>
{
innerTaskList.map((item: Istatus) => {
innerTaskList && innerTaskList.map((item: Istatus) => {
return (
<Step title={item.taskName} status={item.isExecute == 1 ? 'finish' : 'wait'} description={item.roleName} key={item.step} />
)
......
.header {
background: #F7F8FA;
padding: 25px 24px;
margin: 24px 0;
font-size: 12px;
.detailItem {
margin-bottom: 16px;
}
.heightLight {
color: @main-color;
}
.title {
margin-right: 40px;
color: #909399;
}
.status {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.action {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
color: #C0C4CC;;
}
}
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import { Card, Tabs, Table, Radio, Row, Col } from 'antd';
import _groupBy from 'lodash/groupBy';
import styles from './index.less';
import classname from 'classnames';
import moment from 'moment';
const TabPane = Tabs.TabPane;
const format = 'YYYY-MM-DD HH:mm:ss';
const ReceiptDeliveryDetails = (props) => {
const { statisticsColumn, statisticsData, pnoReceiveDeliverDetailDOList = [], pnoReceiveDeliverDetailColumns } = props;
const [activeBatch, setActiveBatch] = useState(0);
const [activeData, setActiveData] = useState<any>({});
useEffect(() => {
if(pnoReceiveDeliverDetailDOList && pnoReceiveDeliverDetailDOList.length > 0) {
setActiveData(pnoReceiveDeliverDetailDOList[0])
}
}, [pnoReceiveDeliverDetailDOList])
const handleOnChange = (e) => {
setActiveBatch(e.target.value)
setActiveData(pnoReceiveDeliverDetailDOList[e.target.value])
}
return (
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs>
<TabPane tab="收发货统计" key="1">
<Table rowKey={"id"} columns={statisticsColumn} dataSource={statisticsData} />
</TabPane>
<TabPane tab="收发货明细" key="2">
<div >
<Radio.Group value={activeBatch} onChange={handleOnChange}>
{
pnoReceiveDeliverDetailDOList && pnoReceiveDeliverDetailDOList.map((item, key) => {
return (
<Radio.Button key={item.deliveryBatch} value={key}>{item.deliveryBatch} 批次</Radio.Button>
)
})
}
</Radio.Group>
</div>
<div >
<div className={styles.header}>
<Row>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>发货单号</span>
<a className={classname(styles.value)}>{activeData.deliveryNo}</a>
</div>
<div>
<span className={styles.title}>发货时间</span>
<span className={styles.value}>{activeData.deliveryTime && moment(activeData.deliveryTime).format(format)}</span>
</div>
</Col>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>物流单号</span>
<a className={styles.value}>{activeData.logisticsOrderNo}</a>
</div>
<div>
<span className={styles.title}>物流公司</span>
<span className={styles.value}>{activeData.logisticsCompany}</span>
</div>
</Col>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>入库单号</span>
<span className={styles.value}>{activeData.storageNo}</span>
</div>
<div>
<span className={styles.title}>入库时间</span>
<span className={styles.value}>{activeData.storageTime && moment(activeData.storageTime).format(format)}</span>
</div>
</Col>
<Col span={4} className={styles.status}>
<div>
<span className={styles.title}>内部状态</span>
<span className={styles.value}>{activeData.deliverStatus}</span>
</div>
</Col>
<Col span={2} className={styles.action}>
<div>
确认回单
</div>
</Col>
</Row>
</div>
<Table
dataSource={activeData.pnoReceiveDeliverDetailProductBOList}
rowKey={"orderNo"}
columns={pnoReceiveDeliverDetailColumns}
/>
</div>
</TabPane>
</Tabs>
</Card>
)
}
export default ReceiptDeliveryDetails;
\ No newline at end of file
......@@ -20,9 +20,9 @@ import {
PENDING_SECOND_VIEW_PATH,
PENDING_CONFIRM_PATH,
PROCESS_INVOICE_TO_BE_ADD_PATH, //以上代表路径
PENDING_ADD_LOGISTICS_PATH,
PENDING_DELIVERED_PATH,
PENDING_RECEIPT_PATH,
// PENDING_ADD_LOGISTICS_PATH,
// PENDING_DELIVERED_PATH,
// PENDING_RECEIPT_PATH,
} from './contants';
import { timeRange } from '@/utils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
......@@ -33,16 +33,16 @@ import ExamineModal from '../../components/ExamineModal';
const formActions = createFormActions();
// 根据 lastTypeParams, 获取相对应的schema
export const SCHEMAS = {
export const SCHEMAS = {
[PATH]: querySchema,
[PENDING_VIEW_PATH]: basicSchema, // 待新增生产通知
[PENDING_FIRST_VIEW_PATH]: pendingFirstQuerySchema,
[PENDING_SECOND_VIEW_PATH]: pendingFirstQuerySchema,
[PENDING_CONFIRM_PATH]: basicSchema, // 带审核生产通知单
[PROCESS_INVOICE_TO_BE_ADD_PATH]: basicSchema,
[PENDING_ADD_LOGISTICS_PATH]: basicSchema,
[PENDING_DELIVERED_PATH]: basicSchema,
[PENDING_RECEIPT_PATH]: basicSchema
// [PENDING_ADD_LOGISTICS_PATH]: basicSchema,
// [PENDING_DELIVERED_PATH]: basicSchema,
// [PENDING_RECEIPT_PATH]: basicSchema
}
console.log(basicSchema);
......@@ -53,9 +53,9 @@ const SERVICES = {
[PENDING_FIRST_VIEW_PATH]: PublicApi.getEnhanceProcessToBeFirstExamList,
[PENDING_SECOND_VIEW_PATH]: PublicApi.getEnhanceProcessToBeSecondExamList,
[PENDING_CONFIRM_PATH]: PublicApi.getEnhanceProcessToBeConfirmList,
[PROCESS_INVOICE_TO_BE_ADD_PATH]: PublicApi.getEnhanceProcessToBeAddDeliveryList,
[PENDING_ADD_LOGISTICS_PATH]: PublicApi.getEnhanceProcessToBeAddLogisticsList,
[PENDING_RECEIPT_PATH]: PublicApi.getEnhanceProcessToBeConfirmReceiptList
// [PROCESS_INVOICE_TO_BE_ADD_PATH]: PublicApi.getEnhanceProcessToBeAddDeliveryList,
// [PENDING_ADD_LOGISTICS_PATH]: PublicApi.getEnhanceProcessToBeAddLogisticsList,
// [PENDING_RECEIPT_PATH]: PublicApi.getEnhanceProcessToBeConfirmReceiptList
}
const Query: React.FC<{}> = (props) => {
......@@ -124,23 +124,24 @@ const Query: React.FC<{}> = (props) => {
title: '操作',
render: (text, record: any) => {
const url = pathname + "/detail";
console.log(url);
const actionMap = {
[PENDING_VIEW_PATH]: <Link to={`${url}?id=${record.id}`}>提交审核</Link>,
[PENDING_FIRST_VIEW_PATH]: <Link to={`${url}?id=${record.id}`}>审核</Link>,
[PENDING_SECOND_VIEW_PATH]: <Link to={`${url}?id=${record.id}`}>审核</Link>,
[PENDING_CONFIRM_PATH]: <Link to={`${url}?id=${record.id}`}>确认通知单</Link>,
[PROCESS_INVOICE_TO_BE_ADD_PATH]: (
record.status == 0
? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/add`}>新增加工发货单</Link>
: <a>确认审核</a>
),
[PENDING_ADD_LOGISTICS_PATH]: (
record.status == 0
? <Link to={`/memberCenter/handling/confirm/createLogisticsOrder`}>新增物流单</Link>
: <Link to={`/memberCenter/handling/confirm/createLogisticsOrder`}>查看物流单</Link>
),
[PENDING_DELIVERED_PATH]: <Link to={`${url}?id=${record.id}`}>发货</Link>,
[PENDING_RECEIPT_PATH]: <Link to={`${url}?id=${record.id}`}>确认回单</Link>
// [PROCESS_INVOICE_TO_BE_ADD_PATH]: (
// record.status == 0
// ? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/add`}>新增加工发货单</Link>
// : <a>确认审核</a>
// ),
// [PENDING_ADD_LOGISTICS_PATH]: (
// record.status == 0
// ? <Link to={`/memberCenter/handling/confirm/createLogisticsOrder`}>新增物流单</Link>
// : <Link to={`/memberCenter/handling/confirm/createLogisticsOrder`}>查看物流单</Link>
// ),
// [PENDING_DELIVERED_PATH]: <Link to={`${url}?id=${record.id}`}>发货</Link>,
// [PENDING_RECEIPT_PATH]: <Link to={`${url}?id=${record.id}`}>确认回单</Link>
}
return (
<Space>
......
......@@ -56,8 +56,8 @@ const UserCenter: React.FC<Iprops> = () => {
{
userAuth.roles.map((item, key) => {
return (
<div style={{marginRight: '8px'}}>
<StatusTag type="success" key={key} title={item.memberRoleName} />
<div style={{marginRight: '8px'}} key={key}>
<StatusTag type="success" title={item.memberRoleName} />
</div>
)
})
......
import React, { useState, useEffect } from 'react'
import React, { useState } from 'react'
import { Modal } from 'antd'
import {
SchemaForm,
SchemaMarkupField as Field,
createAsyncFormActions,
FormEffectHooks,
createFormActions
FormEffectHooks
} from '@formily/antd'
import { Input, Switch, Select, FormMegaLayout, Radio } from '@formily/antd-components'
import styles from './index.less'
......@@ -33,7 +32,7 @@ const actions = createAsyncFormActions()
const AddInvoice: React.FC<AddAddressPropsType> = (props) => {
const { visible = false, title, onOk, onCancel, editItem, type } = props
const [state, setState] = useState({ editable: true })
const [state] = useState({ editable: true })
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [invoiceTitle, setInvoiceTitle] = useState<string>("发票抬头")
const [invoiceTitleTip, setInvoiceTitleTip] = useState<string>("请输入发票抬头")
......
......@@ -12,6 +12,7 @@ import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
import copy from 'copy-to-clipboard'
import cx from 'classnames'
import styles from './index.less'
import { getAuth } from '@/utils/auth'
import { isEmpty } from '@formily/antd/esm/shared'
interface ShopInfoPropsType {
......@@ -43,8 +44,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const fetchAllShop = () => {
//@ts-ignore
PublicApi.getManageShopFindShopsBySiteId({ siteId, type: 1 }).then(res => {
const param: any = {
siteId,
type: 1
}
PublicApi.getManageShopFindShopsBySiteId(param).then(res => {
if (res.code === 1000) {
setAllMallList(res.data)
}
......@@ -55,7 +59,13 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取店铺信息
*/
const fetchShopInfo = () => {
PublicApi.getTemplateShopFindShop().then(res => {
const { memberId, memberRoleId } = getAuth() || {}
const param: any = {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
......@@ -91,7 +101,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const handleAddNewCitySelect = (item: any) => {
let temp = [...selectCityData]
const temp = [...selectCityData]
temp.push(item)
setSelectCityData(temp)
form.setFieldsValue({
......@@ -135,8 +145,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const handleSave = (e: any) => {
e.preventDefault()
console.log(selectCityData)
form.validateFields().then(value => {
form.validateFields().then((value: any) => {
if (!checkMemberShopAreas(value.memberShopAreas)) {
return
}
......@@ -146,7 +155,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
value.storeUrl = storeUrl || `${siteUrl}/shop`
value.shopId = shopId
//@ts-ignore
PublicApi.postTemplateShopSaveShop(value).then(res => {
if (res.code === 1000) {
fetchShopInfo()
......@@ -213,7 +222,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
return null
}
if (shopInfo.shopId && shopInfo.memberId) {
let resUrl = getMallItemAndSetUrl(mallId)
const resUrl = getMallItemAndSetUrl(mallId)
setStoreUrl(resUrl)
} else {
setStoreUrl(null)
......@@ -223,7 +232,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const getMallItemAndSetUrl = (mallId) => {
let result = ""
console.log(mallId, allMallList, "mallId")
let mallItem = allMallList.filter(item => item.id === mallId)[0]
const mallItem = allMallList.filter(item => item.id === mallId)[0]
if (!mallItem) {
return ""
}
......@@ -259,7 +268,7 @@ const ShopInfo: 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>
......@@ -394,7 +403,7 @@ const ShopInfo: 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>
......
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