Commit 78925a60 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 交易能力 -> 进销存国际化

parent 32a68cc0
...@@ -18,6 +18,7 @@ import paltformSign from './zh-CN/marketingAbility/paltformSign' ...@@ -18,6 +18,7 @@ import paltformSign from './zh-CN/marketingAbility/paltformSign'
import logistics from './zh-CN/logistics' import logistics from './zh-CN/logistics'
import dealAbility from './zh-CN/dealAbility' import dealAbility from './zh-CN/dealAbility'
import purchaserEvaluation from './zh-CN/purchaserEvaluation' import purchaserEvaluation from './zh-CN/purchaserEvaluation'
import stockSellStorage from './zh-CN/stockSellStorage'
import content from './zh-CN/content' import content from './zh-CN/content'
import commodity from './zh-CN/commodity' import commodity from './zh-CN/commodity'
import trademark from './zh-CN/trademark' import trademark from './zh-CN/trademark'
...@@ -51,6 +52,7 @@ export default { ...@@ -51,6 +52,7 @@ export default {
...logistics, ...logistics,
...dealAbility, ...dealAbility,
...purchaserEvaluation, ...purchaserEvaluation,
...stockSellStorage,
...content, ...content,
...processRuleSetting, ...processRuleSetting,
} }
export default {
'stockSellStorage.shanchudaorupici': '删除导入批次',
'stockSellStorage.piliangshanchu': '批量删除',
'stockSellStorage.piliangshenhe': '批量审核',
'stockSellStorage.piliangfanshen': '批量反审',
'stockSellStorage.danjuhao': '单据号',
'stockSellStorage.danjuleixing': '单据类型',
'stockSellStorage.danjuzhaiyao': '单据摘要',
'stockSellStorage.huiyuanmingcheng': '会员名称',
'stockSellStorage.duiyingcangku': '对应仓库',
'stockSellStorage.jiaoyishijian': '交易时间',
'stockSellStorage.dingdanhao': '订单号',
'stockSellStorage.danjuzhuangtai': '单据状态',
'stockSellStorage.caozuo': '操作',
'stockSellStorage.shenhe': '审核',
'stockSellStorage.fanshen': '反审',
'stockSellStorage.shanchu': '删除',
'stockSellStorage.quedingyaoshanchuma': '确定要删除吗?',
'stockSellStorage.shi': '是',
'stockSellStorage.fou': '否',
'stockSellStorage.xiugai': '修改',
'stockSellStorage.xinjian': '新建',
'stockSellStorage.daoru': '导入',
'stockSellStorage.gengduo': '更多',
'stockSellStorage.danjuziliao': '单据资料',
'stockSellStorage.dingdanzhaiyao': '订单摘要',
'stockSellStorage.xiadanshijian': '下单时间',
'stockSellStorage.dingdanleixing': '订单类型',
'stockSellStorage.dingdanzhuangtai': '订单状态',
'stockSellStorage.tongzhidanhao': '通知单号',
'stockSellStorage.tongzhidanzhaiyao': '通知单摘要',
'stockSellStorage.jiagongqiyemingcheng': '加工企业名称',
'stockSellStorage.danjushijian': '单据时间',
'stockSellStorage.shenqingdanzhuangtai': '申请单状态',
'stockSellStorage.gongyinghuiyuan': '供应会员',
'stockSellStorage.shenqingdanhao': '申请单号',
'stockSellStorage.shenqingdanzhaiyao': '申请单摘要',
'stockSellStorage.caigouhuiyuan': '采购会员',
'stockSellStorage.huohao': '货号',
'stockSellStorage.huopinmingcheng': '货品名称',
'stockSellStorage.guigexinghao': '规格型号',
'stockSellStorage.pinlei': '品类',
'stockSellStorage.pinpai': '品牌',
'stockSellStorage.qingxuanzeduiyingdanju': '请选择对应单据',
'stockSellStorage.tianjiadanjumingxi': '添加单据明细',
'stockSellStorage.fanhui': '返回',
'stockSellStorage.xinjiandanju': '新建单据',
'stockSellStorage.bianjidanju': '编辑单据',
'stockSellStorage.zhakandanju': '查看单据',
'stockSellStorage.baocun': '保存',
'stockSellStorage.xuanzehuopin': '选择货品',
'stockSellStorage.ninhaiyouweibaocundenei': '您还有未保存的内容,是否确定要离开?',
'stockSellStorage.biaoti': '标题',
'stockSellStorage.xuanzedingdan': '选择订单',
'stockSellStorage.xuanzeshengchantongzhidan': '选择生产通知单',
'stockSellStorage.xuanzeshouhoudan': '选择售后单',
'stockSellStorage.cunzaixiangtonghuohaoshang': '存在相同货号+商品的组合,请重新选择',
'stockSellStorage.shangpinpeisongfangshibuyi': '商品配送方式不一致,请保持一次性',
'stockSellStorage.tishi': '提示',
'stockSellStorage.danjushuliangyichaoguoshang': '单据数量已超过商品数量',
'stockSellStorage.queren': '确认',
'stockSellStorage.quxiao': '取消',
'stockSellStorage.danjushuliangyichaoguojia': '单据数量已超过加工数量',
'stockSellStorage.danjushuliangyichaoguohuan': '单据数量已超过换货数量',
'stockSellStorage.danjushuliangyichaoguotui': '单据数量已超过退货数量',
'stockSellStorage.shurucangkumingcheng': '输入 仓库名称 进行搜索',
'stockSellStorage.sousuo': '搜索',
'stockSellStorage.qingxuanzejiaoyishijian': '请选择交易时间',
'stockSellStorage.qingxuanzedanjuzhuangtai': '请选择单据状态',
'stockSellStorage.qingxuanzeduiyingcangku': '请选择对应仓库',
'stockSellStorage.qingxuanzedanjuleixing': '请选择单据类型',
'stockSellStorage.cangkumingcheng': '仓库名称',
'stockSellStorage.qingshuru': '请输入',
'stockSellStorage.qingshurucangkumingcheng': '请输入仓库名称',
'stockSellStorage.sheng': '- 省 -',
'stockSellStorage.shi1': '- 市 -',
'stockSellStorage.xianqu': '- 县 / 区 -',
'stockSellStorage.qingshuruxiangxidizhi': '请输入详细地址(最长50个字符,25个汉字)',
'stockSellStorage.cangkufuzhairen': '仓库负责人',
'stockSellStorage.lianxidianhua': '联系电话',
'stockSellStorage.qingxuanze': '请选择',
'stockSellStorage.qingshurunideshoujihao': '请输入你的手机号码',
'stockSellStorage.qingshuruzhengquegeshide': '请输入正确格式的手机号',
'stockSellStorage.jiagongqiye': '加工企业',
'stockSellStorage.qingxuanzedanjushijian': '请选择单据时间',
'stockSellStorage.jibenxinxi': '基本信息',
'stockSellStorage.cangkurenyuan': '仓库人员',
'stockSellStorage.duiyingdanju': '对应单据',
'stockSellStorage.dingdan': '订单',
'stockSellStorage.huanhuoshenqingdan': '换货申请单',
'stockSellStorage.tuihuoshenqingdan': '退货申请单',
'stockSellStorage.shengchantongzhidan': '生产通知单',
'stockSellStorage.neibudanju': '内部单据',
'stockSellStorage.guanliandanju': '关联单据',
'stockSellStorage.guanlian': '关联',
'stockSellStorage.qingguanliandanju': '请关联单据',
'stockSellStorage.qingshurudanjuzhaiyao': '请输入单据摘要',
'stockSellStorage.qingshurucangkurenyuan': '请输入仓库人员',
'stockSellStorage.beizhu': '备注',
'stockSellStorage.dizhi': '地址',
'stockSellStorage.wuliufangshi': '物流方式',
'stockSellStorage.danjumingxi': '单据明细',
'stockSellStorage.qingtianjiadanjumingxi': '请添加单据明细',
'stockSellStorage.shangpinID': '商品ID',
'stockSellStorage.wuliaobianhao': '物料编号',
'stockSellStorage.danwei': '单位',
'stockSellStorage.danjia': '单价',
'stockSellStorage.qingshuruzhengquedeshuliang': '请输入正确的数量',
'stockSellStorage.jine': '金额',
'stockSellStorage.shuliang': '数量',
'stockSellStorage.shangpinmingcheng': '商品名称',
'stockSellStorage.wuliaomingchengguige': '物料名称、规格',
'stockSellStorage.shouhuodizhi': '收货地址',
'stockSellStorage.chengbenjia': '成本价',
'stockSellStorage.qingxuanzeshangpin': '请选择商品',
'stockSellStorage.danjushuliang': '单据数量',
'stockSellStorage.qingshurudanjushuliang': '请输入单据数量',
'stockSellStorage.dingdanhaoquanbu': '订单号(全部)',
'stockSellStorage.dingdanzhaiyaoquanbu': '订单摘要(全部)',
'stockSellStorage.huiyuanmingchengquanbu': '会员名称(全部)',
'stockSellStorage.xiadanshijianquanbu': '下单时间(全部)',
'stockSellStorage.dingdanleixingquanbu': '订单类型(全部)',
'stockSellStorage.chaxun': '查询',
'stockSellStorage.shurutongzhidanhao': '输入 通知单号 进行搜索',
'stockSellStorage.shuruhuopinmingcheng': '输入 货品名称 进行搜索',
'stockSellStorage.xinzeng': '新增',
'stockSellStorage.zhakan': '查看',
'stockSellStorage.shurudanjuhao': '输入 单据号 进行搜索',
'stockSellStorage.danjuleixingbianhao': '单据类型编号',
'stockSellStorage.danjumingcheng': '单据名称',
'stockSellStorage.fangxiang': '方向',
'stockSellStorage.zhuangtai': '状态',
'stockSellStorage.bianji': '编辑',
'stockSellStorage.quedingyaoshanchugaidanju': '确定要删除该单据类型吗?',
'stockSellStorage.xinjiandanjuleixing': '新建单据类型',
'stockSellStorage.bianjidanjuleixing': '编辑单据类型',
'stockSellStorage.zhakandanjuleixing': '查看单据类型',
'stockSellStorage.zuichang10gezifu': '最长10个字符',
'stockSellStorage.qingshurudanjuleixingbian': '请输入单据类型编号',
'stockSellStorage.qingshurufeizhongwenzifu': '请输入非中文字符,可以是字母 + 数字 + 字符的组合',
'stockSellStorage.danjuleixingmingcheng': '单据类型名称',
'stockSellStorage.zuichang20gezifu10ge': '最长20个字符,10个汉字',
'stockSellStorage.danjuleixingfangxiang': '单据类型方向',
'stockSellStorage.shurudanjumingcheng': '输入 单据名称 进行搜索',
'stockSellStorage.cangku': '仓库',
'stockSellStorage.qingshuruzhengshu': '请输入正数',
'stockSellStorage.anquankucun': '安全库存',
'stockSellStorage.kucun': '库存',
'stockSellStorage.tiaozhenganquankucun': '调整安全库存',
'stockSellStorage.cangkudizhi': '仓库地址',
'stockSellStorage.quedingyaoshanchugaicangwei': '确定要删除该仓位吗?',
'stockSellStorage.xinjiancangku': '新建仓库',
'stockSellStorage.bianjicangku': '编辑仓库',
'stockSellStorage.zhakancangku': '查看仓库',
}
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-12-22 18:01:50 * @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:43:08 * @LastEditTime: 2021-06-02 16:43:08
* @Description: 单据列表 弹窗表格列 * @Description: 单据列表 弹窗表格列
*/ */
import moment from 'moment'; import moment from 'moment';
import { import {
ORDER_TYPE2, ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts, PurchaseOrderInsideWorkStateTexts,
} from '@/constants/order'; } from '@/constants/order';
import { getIntl } from 'umi';
/** const intl = getIntl();
* 采购订单-弹窗表格列 /**
*/ * 采购订单-弹窗表格列
export const purchaseOrderColumns: any[] = [ */
{ export const purchaseOrderColumns: any[] = [
title: '订单号', {
align: 'center', title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
dataIndex: 'orderNo', align: 'center',
}, dataIndex: 'orderNo',
{ },
title: '订单摘要', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
dataIndex: 'orderThe', align: 'center',
}, dataIndex: 'orderThe',
{ },
title: '会员名称', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
dataIndex: 'supplyMembersName', align: 'center',
}, dataIndex: 'supplyMembersName',
{ },
title: '下单时间', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
dataIndex: 'createTime', align: 'center',
}, dataIndex: 'createTime',
{ },
title: '订单类型', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
dataIndex: 'type', align: 'center',
render: text => ORDER_TYPE2[text], dataIndex: 'type',
}, render: text => ORDER_TYPE2[text],
{ },
title: '订单状态', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
dataIndex: 'interiorState', align: 'center',
render: text => PurchaseOrderInsideWorkStateTexts[text], dataIndex: 'interiorState',
}, render: text => PurchaseOrderInsideWorkStateTexts[text],
]; },
];
/**
* 销售订单-弹窗表格列 /**
*/ * 销售订单-弹窗表格列
export const salesOrderColumns: any[] = [ */
{ export const salesOrderColumns: any[] = [
title: '订单号', {
align: 'center', title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
dataIndex: 'orderNo', align: 'center',
}, dataIndex: 'orderNo',
{ },
title: '订单摘要', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
dataIndex: 'orderThe', align: 'center',
}, dataIndex: 'orderThe',
{ },
title: '会员名称', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
dataIndex: 'createMemberName', align: 'center',
}, dataIndex: 'createMemberName',
{ },
title: '下单时间', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
dataIndex: 'createTime', align: 'center',
}, dataIndex: 'createTime',
{ },
title: '订单类型', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
dataIndex: 'type', align: 'center',
render: text => ORDER_TYPE2[text], dataIndex: 'type',
}, render: text => ORDER_TYPE2[text],
{ },
title: '订单状态', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
dataIndex: 'interiorState', align: 'center',
render: text => PurchaseOrderInsideWorkStateTexts[text], dataIndex: 'interiorState',
}, render: text => PurchaseOrderInsideWorkStateTexts[text],
]; },
];
/**
* 加工入库单列表 /**
*/ * 加工入库单列表
export const machiningWarehousingColumns = [ */
{ export const machiningWarehousingColumns = [
title: '通知单号', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
dataIndex: 'noticeNo', align: 'center',
}, dataIndex: 'noticeNo',
{ },
title: '通知单摘要', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
dataIndex: 'summary', align: 'center',
}, dataIndex: 'summary',
{ },
title: '加工企业名称', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.jiagongqiyemingcheng'}),
dataIndex: 'processName', align: 'center',
}, dataIndex: 'processName',
{ },
title: '单据时间', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
dataIndex: 'createTime', align: 'center',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'), dataIndex: 'createTime',
}, render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
{ },
title: '申请单状态', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
dataIndex: 'outerStatusName', align: 'center',
}, dataIndex: 'outerStatusName',
]; },
];
/**
* 加工发货单列表 /**
*/ * 加工发货单列表
export const machiningDeliveryColumns = [ */
{ export const machiningDeliveryColumns = [
title: '通知单号', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
dataIndex: 'noticeNo', align: 'center',
}, dataIndex: 'noticeNo',
{ },
title: '通知单摘要', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
dataIndex: 'summary', align: 'center',
}, dataIndex: 'summary',
{ },
title: '供应会员', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
dataIndex: 'supplierName', align: 'center',
}, dataIndex: 'supplierName',
{ },
title: '单据时间', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
dataIndex: 'createTime', align: 'center',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'), dataIndex: 'createTime',
}, render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
{ },
title: '申请单状态', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
dataIndex: 'outerStatusName', align: 'center',
}, dataIndex: 'outerStatusName',
]; },
];
/**
* 售后发货、入库订单列表 /**
*/ * 售后发货、入库订单列表
export const getAfterSaleColumns = (isPurchaser?: boolean) => { */
return [ export const getAfterSaleColumns = (isPurchaser?: boolean) => {
{ return [
title: '申请单号', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.shenqingdanhao'}),
dataIndex: 'applyNo', align: 'center',
}, dataIndex: 'applyNo',
{ },
title: '申请单摘要', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhaiyao'}),
dataIndex: 'applyAbstract', align: 'center',
}, dataIndex: 'applyAbstract',
isPurchaser ? { },
title: '供应会员', isPurchaser ? {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
dataIndex: 'supplierName', align: 'center',
} : { dataIndex: 'supplierName',
title: '采购会员', } : {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.caigouhuiyuan'}),
dataIndex: 'consumerName', align: 'center',
}, dataIndex: 'consumerName',
{ },
title: '单据时间', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
dataIndex: 'applyTime', align: 'center',
}, dataIndex: 'applyTime',
{ },
title: '申请单状态', {
align: 'center', title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
dataIndex: 'outerStatusName', align: 'center',
}, dataIndex: 'outerStatusName',
]; },
}; ];
\ No newline at end of file };
This source diff could not be displayed because it is too large. You can view the blob instead.
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getIntl } from 'umi';
export const billsSchema: ISchema = { const intl = getIntl();
type: 'object', export const billsSchema: ISchema = {
properties: { type: 'object',
megaLayout: { properties: {
type: 'object', megaLayout: {
'x-component': 'mega-layout', type: 'object',
properties: { 'x-component': 'mega-layout',
topLayout: { properties: {
type: 'object', topLayout: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
grid: true, 'x-component-props': {
}, grid: true,
properties: { },
ctl: { properties: {
type: 'object', ctl: {
'x-component': 'Children', type: 'object',
'x-component-props': { 'x-component': 'Children',
children: '{{controllerBtns}}', 'x-component-props': {
}, children: '{{controllerBtns}}',
}, },
invoicesNo: { },
type: 'string', invoicesNo: {
'x-component': 'Search', type: 'string',
'x-mega-props': {}, 'x-component': 'Search',
'x-component-props': { 'x-mega-props': {},
placeholder: '搜索', 'x-component-props': {
tip: '输入 单据号 进行搜索', placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
}, tip: intl.formatMessage({id: 'stockSellStorage.shurudanjuhao'})
}, },
}, },
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'flex-layout', type: 'object',
'x-component-props': { 'x-component': 'flex-layout',
rowStyle: { 'x-component-props': {
flexWrap: 'nowrap', rowStyle: {
}, flexWrap: 'nowrap',
colStyle: { },
marginLeft: 20, colStyle: {
}, marginLeft: 20,
}, },
properties: { },
invoicesAbstract: { properties: {
type: 'string', invoicesAbstract: {
'x-component-props': { type: 'string',
placeholder: '单据摘要', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
width: 160, style: {
}, width: 160,
}, },
}, },
memberName: { },
type: 'string', memberName: {
'x-component-props': { type: 'string',
placeholder: '会员名称', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
width: 160, style: {
}, width: 160,
}, },
}, },
orderNo: { },
type: 'string', orderNo: {
'x-component-props': { type: 'string',
placeholder: '订单号', 'x-component-props': {
style: { placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
width: 160, style: {
}, width: 160,
}, },
}, },
invoicesTypeId: { },
type: 'string', invoicesTypeId: {
'x-component-props': { type: 'string',
placeholder: '单据类型', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'stockSellStorage.danjuleixing'}),
style: { allowClear: true,
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
inventory: { },
type: 'string', inventory: {
'x-component-props': { type: 'string',
placeholder: '对应仓库', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'stockSellStorage.duiyingcangku'}),
style: { allowClear: true,
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
'[startTransactionTime, endTransactionTime]': { },
type: 'string', '[startTransactionTime, endTransactionTime]': {
'x-component': 'dateSelect', type: 'string',
'x-component-props': { 'x-component': 'dateSelect',
placeholder: '交易时间', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'stockSellStorage.jiaoyishijian'}),
style: { allowClear: true,
width: 160, style: {
}, width: 160,
}, },
}, },
submit: { },
'x-component': 'Submit', submit: {
'x-mega-props': { 'x-component': 'Submit',
span: 1, 'x-mega-props': {
}, span: 1,
'x-component-props': { },
children: '查询', 'x-component-props': {
}, children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
}, },
}, },
}, },
}, },
}, },
}, },
}; },
\ No newline at end of file };
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Button, Card, Spin } from 'antd'; import { Button, Card, Spin } from 'antd';
import { history, Prompt } from 'umi'; import { getIntl, history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons'; import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { getProductInvoicesTypeDetails, postProductInvoicesTypeAdd, postProductInvoicesTypeUpdate } from '@/services/ProductV2Api'; import { getProductInvoicesTypeDetails, postProductInvoicesTypeAdd, postProductInvoicesTypeUpdate } from '@/services/ProductV2Api';
import { billsTypeDetailSchema } from './schema'; import { billsTypeDetailSchema } from './schema';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
onFormInputChange$, onFormInputChange$,
} = FormEffectHooks; } = FormEffectHooks;
interface BillTypeFormProps { interface BillTypeFormProps {
id?: string; id?: string;
validateId?: string; validateId?: string;
// 是否是编辑的 // 是否是编辑的
isEdit?: boolean; isEdit?: boolean;
}; };
const intl = getIntl();
const BillTypeForm: React.FC<BillTypeFormProps> = ({ const BillTypeForm: React.FC<BillTypeFormProps> = ({
id, id,
isEdit = false, isEdit = false,
}) => { }) => {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const [unsaved, setUnsaved] = useState(false); const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const docTypeInfo = async () => { const docTypeInfo = async () => {
if (!id) { if (!id) {
return; return;
} }
setInfoLoading(true); setInfoLoading(true);
const infoRes = await getProductInvoicesTypeDetails({ const infoRes = await getProductInvoicesTypeDetails({
id, id,
}); });
if (infoRes.code === 1000) { if (infoRes.code === 1000) {
setInfo(infoRes.data); setInfo(infoRes.data);
} }
setInfoLoading(false); setInfoLoading(false);
}; };
useEffect(() => { useEffect(() => {
docTypeInfo(); docTypeInfo();
}, []); }, []);
const handleSubmit = value => { const handleSubmit = value => {
if (!id) { if (!id) {
if (isEdit) { if (isEdit) {
return; return;
} }
setSubmitLoading(true); setSubmitLoading(true);
postProductInvoicesTypeAdd({ ...value }) postProductInvoicesTypeAdd({ ...value })
.then(res => { .then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setTimeout(() => { setTimeout(() => {
history.goBack() history.goBack()
}, 800); }, 800);
}; };
}) })
.finally(() => { .finally(() => {
setSubmitLoading(false); setSubmitLoading(false);
}); });
} else { } else {
if (!isEdit) { if (!isEdit) {
return; return;
} }
setSubmitLoading(true); setSubmitLoading(true);
postProductInvoicesTypeUpdate({ postProductInvoicesTypeUpdate({
id: id, id: id,
...value, ...value,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
history.goBack(); history.goBack();
} }
}); });
} }
setUnsaved(false); setUnsaved(false);
}; };
return ( return (
<Spin spinning={infoLoading}> <Spin spinning={infoLoading}>
<PageHeaderWrapper <PageHeaderWrapper
style={{ style={{
padding: 24, padding: 24,
}} }}
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'stockSellStorage.fanhui' })} />}
title={ title={
!id ? !id ?
'新建单据类型' : intl.formatMessage({ id: 'stockSellStorage.xinjiandanjuleixing' }) :
isEdit ? isEdit ?
'编辑单据类型' : intl.formatMessage({ id: 'stockSellStorage.bianjidanjuleixing' }) :
'查看单据类型' intl.formatMessage({ id: 'stockSellStorage.zhakandanjuleixing' })
} }
extra={ extra={
(isEdit || !id) (isEdit || !id)
? [ ? [
<Button <Button
key="1" key="1"
type="primary" type="primary"
icon={<SaveOutlined />} icon={<SaveOutlined />}
loading={submitLoading} loading={submitLoading}
onClick={() => formActions.submit()} onClick={() => formActions.submit()}
> >
保存 {intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>, </Button>,
] ]
: [] : []
} }
> >
<Card> <Card>
<NiceForm <NiceForm
previewPlaceholder="' '" previewPlaceholder="' '"
editable={isEdit || !id} editable={isEdit || !id}
effects={$ => { effects={$ => {
onFormInputChange$().subscribe(() => { onFormInputChange$().subscribe(() => {
if (!unsaved) { if (!unsaved) {
setUnsaved(true); setUnsaved(true);
} }
}); });
}} }}
initialValues={info} initialValues={info}
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={formActions} actions={formActions}
schema={billsTypeDetailSchema} schema={billsTypeDetailSchema}
/> />
</Card> </Card>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" /> <Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})}/>
</PageHeaderWrapper> </PageHeaderWrapper>
</Spin> </Spin>
); );
}; };
export default BillTypeForm; export default BillTypeForm;
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35 * @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:08:24 * @LastEditTime: 2021-06-02 16:08:24
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { DOC_DIRECTION_WAREHOUSING, DOC_DIRECTION_OUTGOING, DOC_DIRECTION } from '@/constants/commodity'; import { DOC_DIRECTION_WAREHOUSING, DOC_DIRECTION_OUTGOING, DOC_DIRECTION } from '@/constants/commodity';
import { getIntl } from 'umi';
export const billsTypeDetailSchema: ISchema = { const intl = getIntl();
type: 'object', export const billsTypeDetailSchema: ISchema = {
properties: { type: 'object',
MEGA_LAYOUT: { properties: {
type: 'object', MEGA_LAYOUT: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
labelCol: 4, 'x-component-props': {
wrapperCol: 12, labelCol: 4,
labelAlign: 'left', wrapperCol: 12,
}, labelAlign: 'left',
properties: { },
number: { properties: {
type: 'string', number: {
title: '单据类型编号', type: 'string',
'x-component-props': { title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingbianhao' }),
placeholder: '最长10个字符', 'x-component-props': {
maxLength: 10, placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang10gezifu' }),
}, maxLength: 10,
'x-rules': [ },
{ 'x-rules': [
required: true, {
message: '请输入单据类型编号', required: true,
}, message: intl.formatMessage({ id: 'stockSellStorage.qingshurudanjuleixingbian' }),
{ },
validator: value => { {
const CNReg = /[\u4E00-\u9FA5]/g; validator: value => {
return CNReg.test(value) ? '请输入非中文字符,可以是字母 + 数字 + 字符的组合' : ''; const CNReg = /[\u4E00-\u9FA5]/g;
}, return CNReg.test(value) ? intl.formatMessage({ id: 'stockSellStorage.qingshurufeizhongwenzifu' }) : '';
}, },
], },
}, ],
name: { },
type: 'string', name: {
title: '单据类型名称', type: 'string',
'x-component-props': { title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingmingcheng' }),
placeholder: '最长20个字符,10个汉字', 'x-component-props': {
}, placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang20gezifu10ge' }),
required: true, },
'x-rules': [ required: true,
{ 'x-rules': [
limitByte: true, // 自定义校验规则 {
maxByte: 20, limitByte: true, // 自定义校验规则
} maxByte: 20,
], }
}, ],
direction: { },
type: 'string', direction: {
title: '单据类型方向', type: 'string',
enum: [ title: intl.formatMessage({id: 'stockSellStorage.danjuleixingfangxiang'}),
{ enum: [
label: DOC_DIRECTION[DOC_DIRECTION_WAREHOUSING], {
value: DOC_DIRECTION_WAREHOUSING, label: DOC_DIRECTION[DOC_DIRECTION_WAREHOUSING],
}, value: DOC_DIRECTION_WAREHOUSING,
{ },
label: DOC_DIRECTION[DOC_DIRECTION_OUTGOING], {
value: DOC_DIRECTION_OUTGOING, label: DOC_DIRECTION[DOC_DIRECTION_OUTGOING],
}, value: DOC_DIRECTION_OUTGOING,
], },
'x-component-props': { ],
placeholder: '请选择', 'x-component-props': {
}, placeholder: intl.formatMessage({ id: 'stockSellStorage.qingxuanze' }),
required: true, },
}, required: true,
}, },
}, },
}, },
}; },
\ No newline at end of file };
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
export const searchSchema: ISchema = { const intl = getIntl();
type: 'object', export const searchSchema: ISchema = {
properties: { type: 'object',
searchWrap: { properties: {
type: 'object', searchWrap: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
grid: true, 'x-component-props': {
}, grid: true,
properties: { },
actions: { properties: {
type: 'object', actions: {
'x-component': 'Children', type: 'object',
'x-component-props': { 'x-component': 'Children',
children: '{{Actions}}', 'x-component-props': {
}, children: '{{Actions}}',
}, },
name: { },
type: 'string', name: {
'x-component': 'Search', type: 'string',
'x-component-props': { 'x-component': 'Search',
placeholder: '搜索', 'x-component-props': {
advanced: false, placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: '输入 单据名称 进行搜索', advanced: false,
}, tip: intl.formatMessage({id: 'stockSellStorage.shurudanjumingcheng'}),
}, },
}, },
}, },
}, },
}; },
};
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from 'umi';
export const inventorySchema: ISchema = { const intl = getIntl();
type: 'object', export const inventorySchema: ISchema = {
properties: { type: 'object',
megaLayout: { properties: {
type: 'object', megaLayout: {
'x-component': 'mega-layout', type: 'object',
properties: { 'x-component': 'mega-layout',
goodsName: { properties: {
type: 'string', goodsName: {
'x-component': 'Search', type: 'string',
'x-mega-props': {}, 'x-component': 'Search',
'x-component-props': { 'x-mega-props': {},
placeholder: '搜索', 'x-component-props': {
tip: '输入 货品名称 进行搜索', placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
align: 'flex-left', tip: intl.formatMessage({id: 'stockSellStorage.shuruhuopinmingcheng'}),
}, align: 'flex-left',
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
grid: true, 'x-component-props': {
full: true, grid: true,
autoRow: true, full: true,
columns: 6, autoRow: true,
}, columns: 6,
properties: { },
itemNo: { properties: {
type: 'string', itemNo: {
'x-component-props': { type: 'string',
placeholder: '货号', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.huohao'}),
}, },
specifications: { },
type: 'string', specifications: {
'x-component-props': { type: 'string',
placeholder: '规格型号', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.guigexinghao'}),
}, },
category: { },
type: 'string', category: {
'x-component-props': { type: 'string',
placeholder: '品类', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.pinlei'}),
}, },
brand: { },
type: 'string', brand: {
'x-component-props': { type: 'string',
placeholder: '品牌', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.pinpai'}),
}, },
warehouseId: { },
type: 'string', warehouseId: {
'x-component-props': { type: 'string',
placeholder: '仓库', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.cangku'}),
enum: [], },
}, enum: [],
submit: { },
'x-component': 'Submit', submit: {
'x-mega-props': { 'x-component': 'Submit',
span: 1, 'x-mega-props': {
}, span: 1,
'x-component-props': { },
children: '查询', 'x-component-props': {
}, children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
}, },
}, },
}, },
}, },
}, },
}, },
}; },
};
export const safetyModalSchema: ISchema = {
type: 'object', export const safetyModalSchema: ISchema = {
properties: { type: 'object',
MEAGLAYOUT: { properties: {
type: 'object', MEAGLAYOUT: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
labelAlign: 'top', 'x-component-props': {
}, labelAlign: 'top',
properties: { },
safetyInvoices: { properties: {
type: 'string', safetyInvoices: {
title: '安全库存', type: 'string',
required: true, title: intl.formatMessage({id: 'stockSellStorage.anquankucun'}),
'x-component-props': { required: true,
placeholder: '请输入', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuru'}),
'x-rules': [ },
{ 'x-rules': [
pattern: PATTERN_MAPS.weight, {
message: '请输入正数', pattern: PATTERN_MAPS.weight,
}, message: intl.formatMessage({id: 'stockSellStorage.qingshuruzhengshu'}),
], },
}, ],
}, },
}, },
}, },
}; },
};
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from 'umi';
export const warehouseSchema: ISchema = { const intl = getIntl();
type: 'object', export const warehouseSchema: ISchema = {
properties: { type: 'object',
megaLayout: { properties: {
type: 'object', megaLayout: {
'x-component': 'mega-layout', type: 'object',
properties: { 'x-component': 'mega-layout',
search: { properties: {
type: 'string', search: {
'x-component': 'Search', type: 'string',
'x-mega-props': {}, 'x-component': 'Search',
'x-component-props': { 'x-mega-props': {},
placeholder: '搜索', 'x-component-props': {
}, placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'mega-layout', type: 'object',
visible: false, 'x-component': 'mega-layout',
'x-component-props': { visible: false,
inline: true, 'x-component-props': {
}, inline: true,
properties: { },
invoicesNo: { properties: {
type: 'string', invoicesNo: {
'x-component-props': { type: 'string',
placeholder: '单据号', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.danjuhao'}),
width: 160, style: {
}, width: 160,
}, },
}, },
invoicesAbstract: { },
type: 'string', invoicesAbstract: {
'x-component-props': { type: 'string',
placeholder: '单据摘要', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
width: 160, style: {
}, width: 160,
}, },
}, },
memberName: { },
type: 'string', memberName: {
'x-component-props': { type: 'string',
placeholder: '会员名称', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
width: 160, style: {
}, width: 160,
}, },
}, },
orderNo: { },
type: 'string', orderNo: {
'x-component-props': { type: 'string',
placeholder: '订单号', 'x-component-props': {
style: { placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
width: 160, style: {
}, width: 160,
}, },
}, },
invoicesType: { },
type: 'string', invoicesType: {
'x-component-props': { type: 'string',
placeholder: '请选择单据类型', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuleixing'}),
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
inventory: { },
type: 'string', inventory: {
'x-component-props': { type: 'string',
placeholder: '请选择对应仓库', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzeduiyingcangku'}),
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
state: { },
type: 'string', state: {
'x-component-props': { type: 'string',
placeholder: '请选择单据状态', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuzhuangtai'}),
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
time: { },
type: 'string', time: {
'x-component-props': { type: 'string',
placeholder: '请选择交易时间', 'x-component-props': {
style: { placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzejiaoyishijian'}),
width: 160, style: {
}, width: 160,
}, },
enum: [], },
}, enum: [],
}, },
}, },
}, },
}, },
}, },
}; },
};
export const searchSchema: ISchema = {
type: 'object', export const searchSchema: ISchema = {
properties: { type: 'object',
searchWrap: { properties: {
type: 'object', searchWrap: {
'x-component': 'Mega-Layout', type: 'object',
'x-component-props': { 'x-component': 'Mega-Layout',
grid: true, 'x-component-props': {
}, grid: true,
properties: { },
actions: { properties: {
type: 'object', actions: {
'x-component': 'Children', type: 'object',
'x-component-props': { 'x-component': 'Children',
children: '{{Actions}}', 'x-component-props': {
}, children: '{{Actions}}',
}, },
name: { },
type: 'string', name: {
'x-component': 'Search', type: 'string',
'x-component-props': { 'x-component': 'Search',
placeholder: '搜索', 'x-component-props': {
tip: '输入 仓库名称 进行搜索', placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
advanced: false, tip: intl.formatMessage({id: 'stockSellStorage.shurucangkumingcheng'}),
}, advanced: false,
}, },
}, },
}, },
}, },
}; },
};
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