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

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

parent 32a68cc0
......@@ -18,6 +18,7 @@ import paltformSign from './zh-CN/marketingAbility/paltformSign'
import logistics from './zh-CN/logistics'
import dealAbility from './zh-CN/dealAbility'
import purchaserEvaluation from './zh-CN/purchaserEvaluation'
import stockSellStorage from './zh-CN/stockSellStorage'
import content from './zh-CN/content'
import commodity from './zh-CN/commodity'
import trademark from './zh-CN/trademark'
......@@ -51,6 +52,7 @@ export default {
...logistics,
...dealAbility,
...purchaserEvaluation,
...stockSellStorage,
...content,
...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
* @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:43:08
* @Description: 单据列表 弹窗表格列
*/
import moment from 'moment';
import {
ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts,
} from '@/constants/order';
/**
* 采购订单-弹窗表格列
*/
export const purchaseOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'supplyMembersName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 销售订单-弹窗表格列
*/
export const salesOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'createMemberName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 加工入库单列表
*/
export const machiningWarehousingColumns = [
{
title: '通知单号',
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
align: 'center',
dataIndex: 'summary',
},
{
title: '加工企业名称',
align: 'center',
dataIndex: 'processName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 加工发货单列表
*/
export const machiningDeliveryColumns = [
{
title: '通知单号',
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
align: 'center',
dataIndex: 'summary',
},
{
title: '供应会员',
align: 'center',
dataIndex: 'supplierName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 售后发货、入库订单列表
*/
export const getAfterSaleColumns = (isPurchaser?: boolean) => {
return [
{
title: '申请单号',
align: 'center',
dataIndex: 'applyNo',
},
{
title: '申请单摘要',
align: 'center',
dataIndex: 'applyAbstract',
},
isPurchaser ? {
title: '供应会员',
align: 'center',
dataIndex: 'supplierName',
} : {
title: '采购会员',
align: 'center',
dataIndex: 'consumerName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'applyTime',
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:43:08
* @Description: 单据列表 弹窗表格列
*/
import moment from 'moment';
import {
ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts,
} from '@/constants/order';
import { getIntl } from 'umi';
const intl = getIntl();
/**
* 采购订单-弹窗表格列
*/
export const purchaseOrderColumns: any[] = [
{
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
dataIndex: 'orderNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
dataIndex: 'orderThe',
},
{
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
dataIndex: 'supplyMembersName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
dataIndex: 'createTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 销售订单-弹窗表格列
*/
export const salesOrderColumns: any[] = [
{
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
dataIndex: 'orderNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
dataIndex: 'orderThe',
},
{
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
dataIndex: 'createMemberName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
dataIndex: 'createTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 加工入库单列表
*/
export const machiningWarehousingColumns = [
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
dataIndex: 'noticeNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
dataIndex: 'summary',
},
{
title: intl.formatMessage({id: 'stockSellStorage.jiagongqiyemingcheng'}),
align: 'center',
dataIndex: 'processName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 加工发货单列表
*/
export const machiningDeliveryColumns = [
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
dataIndex: 'noticeNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
dataIndex: 'summary',
},
{
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
dataIndex: 'supplierName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 售后发货、入库订单列表
*/
export const getAfterSaleColumns = (isPurchaser?: boolean) => {
return [
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanhao'}),
align: 'center',
dataIndex: 'applyNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhaiyao'}),
align: 'center',
dataIndex: 'applyAbstract',
},
isPurchaser ? {
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
dataIndex: 'supplierName',
} : {
title: intl.formatMessage({id: 'stockSellStorage.caigouhuiyuan'}),
align: 'center',
dataIndex: 'consumerName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'applyTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
];
};
This source diff could not be displayed because it is too large. You can view the blob instead.
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const billsSchema: 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}}',
},
},
invoicesNo: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
tip: '输入 单据号 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: '单据摘要',
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
style: {
width: 160,
},
},
},
orderNo: {
type: 'string',
'x-component-props': {
placeholder: '订单号',
style: {
width: 160,
},
},
},
invoicesTypeId: {
type: 'string',
'x-component-props': {
placeholder: '单据类型',
allowClear: true,
style: {
width: 160,
},
},
enum: [],
},
inventory: {
type: 'string',
'x-component-props': {
placeholder: '对应仓库',
allowClear: true,
style: {
width: 160,
},
},
enum: [],
},
'[startTransactionTime, endTransactionTime]': {
type: 'string',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getIntl } from 'umi';
const intl = getIntl();
export const billsSchema: 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}}',
},
},
invoicesNo: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: intl.formatMessage({id: 'stockSellStorage.shurudanjuhao'})
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
style: {
width: 160,
},
},
},
orderNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
style: {
width: 160,
},
},
},
invoicesTypeId: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuleixing'}),
allowClear: true,
style: {
width: 160,
},
},
enum: [],
},
inventory: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.duiyingcangku'}),
allowClear: true,
style: {
width: 160,
},
},
enum: [],
},
'[startTransactionTime, endTransactionTime]': {
type: 'string',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.jiaoyishijian'}),
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
},
},
},
},
},
},
},
};
import React, { useState, useEffect } from 'react';
import { Button, Card, Spin } from 'antd';
import { history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { getProductInvoicesTypeDetails, postProductInvoicesTypeAdd, postProductInvoicesTypeUpdate } from '@/services/ProductV2Api';
import { billsTypeDetailSchema } from './schema';
const formActions = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
interface BillTypeFormProps {
id?: string;
validateId?: string;
// 是否是编辑的
isEdit?: boolean;
};
const BillTypeForm: React.FC<BillTypeFormProps> = ({
id,
isEdit = false,
}) => {
const [info, setInfo] = useState({});
const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const docTypeInfo = async () => {
if (!id) {
return;
}
setInfoLoading(true);
const infoRes = await getProductInvoicesTypeDetails({
id,
});
if (infoRes.code === 1000) {
setInfo(infoRes.data);
}
setInfoLoading(false);
};
useEffect(() => {
docTypeInfo();
}, []);
const handleSubmit = value => {
if (!id) {
if (isEdit) {
return;
}
setSubmitLoading(true);
postProductInvoicesTypeAdd({ ...value })
.then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
}, 800);
};
})
.finally(() => {
setSubmitLoading(false);
});
} else {
if (!isEdit) {
return;
}
setSubmitLoading(true);
postProductInvoicesTypeUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
}
setUnsaved(false);
};
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
style={{
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
!id ?
'新建单据类型' :
isEdit ?
'编辑单据类型' :
'查看单据类型'
}
extra={
(isEdit || !id)
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>,
]
: []
}
>
<Card>
<NiceForm
previewPlaceholder="' '"
editable={isEdit || !id}
effects={$ => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
initialValues={info}
onSubmit={handleSubmit}
actions={formActions}
schema={billsTypeDetailSchema}
/>
</Card>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</PageHeaderWrapper>
</Spin>
);
};
export default BillTypeForm;
import React, { useState, useEffect } from 'react';
import { Button, Card, Spin } from 'antd';
import { getIntl, history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { getProductInvoicesTypeDetails, postProductInvoicesTypeAdd, postProductInvoicesTypeUpdate } from '@/services/ProductV2Api';
import { billsTypeDetailSchema } from './schema';
const formActions = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
interface BillTypeFormProps {
id?: string;
validateId?: string;
// 是否是编辑的
isEdit?: boolean;
};
const intl = getIntl();
const BillTypeForm: React.FC<BillTypeFormProps> = ({
id,
isEdit = false,
}) => {
const [info, setInfo] = useState({});
const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const docTypeInfo = async () => {
if (!id) {
return;
}
setInfoLoading(true);
const infoRes = await getProductInvoicesTypeDetails({
id,
});
if (infoRes.code === 1000) {
setInfo(infoRes.data);
}
setInfoLoading(false);
};
useEffect(() => {
docTypeInfo();
}, []);
const handleSubmit = value => {
if (!id) {
if (isEdit) {
return;
}
setSubmitLoading(true);
postProductInvoicesTypeAdd({ ...value })
.then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
}, 800);
};
})
.finally(() => {
setSubmitLoading(false);
});
} else {
if (!isEdit) {
return;
}
setSubmitLoading(true);
postProductInvoicesTypeUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
}
setUnsaved(false);
};
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
style={{
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'stockSellStorage.fanhui' })} />}
title={
!id ?
intl.formatMessage({ id: 'stockSellStorage.xinjiandanjuleixing' }) :
isEdit ?
intl.formatMessage({ id: 'stockSellStorage.bianjidanjuleixing' }) :
intl.formatMessage({ id: 'stockSellStorage.zhakandanjuleixing' })
}
extra={
(isEdit || !id)
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>,
]
: []
}
>
<Card>
<NiceForm
previewPlaceholder="' '"
editable={isEdit || !id}
effects={$ => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
initialValues={info}
onSubmit={handleSubmit}
actions={formActions}
schema={billsTypeDetailSchema}
/>
</Card>
<Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})}/>
</PageHeaderWrapper>
</Spin>
);
};
export default BillTypeForm;
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:08:24
* @Description:
*/
import { ISchema } from '@formily/antd';
import { DOC_DIRECTION_WAREHOUSING, DOC_DIRECTION_OUTGOING, DOC_DIRECTION } from '@/constants/commodity';
export const billsTypeDetailSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
number: {
type: 'string',
title: '单据类型编号',
'x-component-props': {
placeholder: '最长10个字符',
maxLength: 10,
},
'x-rules': [
{
required: true,
message: '请输入单据类型编号',
},
{
validator: value => {
const CNReg = /[\u4E00-\u9FA5]/g;
return CNReg.test(value) ? '请输入非中文字符,可以是字母 + 数字 + 字符的组合' : '';
},
},
],
},
name: {
type: 'string',
title: '单据类型名称',
'x-component-props': {
placeholder: '最长20个字符,10个汉字',
},
required: true,
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
],
},
direction: {
type: 'string',
title: '单据类型方向',
enum: [
{
label: DOC_DIRECTION[DOC_DIRECTION_WAREHOUSING],
value: DOC_DIRECTION_WAREHOUSING,
},
{
label: DOC_DIRECTION[DOC_DIRECTION_OUTGOING],
value: DOC_DIRECTION_OUTGOING,
},
],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
},
},
},
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 16:08:24
* @Description:
*/
import { ISchema } from '@formily/antd';
import { DOC_DIRECTION_WAREHOUSING, DOC_DIRECTION_OUTGOING, DOC_DIRECTION } from '@/constants/commodity';
import { getIntl } from 'umi';
const intl = getIntl();
export const billsTypeDetailSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
number: {
type: 'string',
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingbianhao' }),
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang10gezifu' }),
maxLength: 10,
},
'x-rules': [
{
required: true,
message: intl.formatMessage({ id: 'stockSellStorage.qingshurudanjuleixingbian' }),
},
{
validator: value => {
const CNReg = /[\u4E00-\u9FA5]/g;
return CNReg.test(value) ? intl.formatMessage({ id: 'stockSellStorage.qingshurufeizhongwenzifu' }) : '';
},
},
],
},
name: {
type: 'string',
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingmingcheng' }),
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang20gezifu10ge' }),
},
required: true,
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
],
},
direction: {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.danjuleixingfangxiang'}),
enum: [
{
label: DOC_DIRECTION[DOC_DIRECTION_WAREHOUSING],
value: DOC_DIRECTION_WAREHOUSING,
},
{
label: DOC_DIRECTION[DOC_DIRECTION_OUTGOING],
value: DOC_DIRECTION_OUTGOING,
},
],
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.qingxuanze' }),
},
required: true,
},
},
},
},
};
import { ISchema } from '@formily/antd';
export const searchSchema: ISchema = {
type: 'object',
properties: {
searchWrap: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
actions: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{Actions}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
advanced: false,
tip: '输入 单据名称 进行搜索',
},
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const searchSchema: ISchema = {
type: 'object',
properties: {
searchWrap: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
actions: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{Actions}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
advanced: false,
tip: intl.formatMessage({id: 'stockSellStorage.shurudanjumingcheng'}),
},
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp';
export const inventorySchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
goodsName: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
tip: '输入 货品名称 进行搜索',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
itemNo: {
type: 'string',
'x-component-props': {
placeholder: '货号',
},
},
specifications: {
type: 'string',
'x-component-props': {
placeholder: '规格型号',
},
},
category: {
type: 'string',
'x-component-props': {
placeholder: '品类',
},
},
brand: {
type: 'string',
'x-component-props': {
placeholder: '品牌',
},
},
warehouseId: {
type: 'string',
'x-component-props': {
placeholder: '仓库',
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const safetyModalSchema: ISchema = {
type: 'object',
properties: {
MEAGLAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
safetyInvoices: {
type: 'string',
title: '安全库存',
required: true,
'x-component-props': {
placeholder: '请输入',
},
'x-rules': [
{
pattern: PATTERN_MAPS.weight,
message: '请输入正数',
},
],
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from 'umi';
const intl = getIntl();
export const inventorySchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
goodsName: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: intl.formatMessage({id: 'stockSellStorage.shuruhuopinmingcheng'}),
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
itemNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.huohao'}),
},
},
specifications: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.guigexinghao'}),
},
},
category: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.pinlei'}),
},
},
brand: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.pinpai'}),
},
},
warehouseId: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.cangku'}),
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
},
},
},
},
},
},
},
};
export const safetyModalSchema: ISchema = {
type: 'object',
properties: {
MEAGLAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
safetyInvoices: {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.anquankucun'}),
required: true,
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuru'}),
},
'x-rules': [
{
pattern: PATTERN_MAPS.weight,
message: intl.formatMessage({id: 'stockSellStorage.qingshuruzhengshu'}),
},
],
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp';
export const warehouseSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
properties: {
invoicesNo: {
type: 'string',
'x-component-props': {
placeholder: '单据号',
style: {
width: 160,
},
},
},
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: '单据摘要',
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
style: {
width: 160,
},
},
},
orderNo: {
type: 'string',
'x-component-props': {
placeholder: '订单号',
style: {
width: 160,
},
},
},
invoicesType: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据类型',
style: {
width: 160,
},
},
enum: [],
},
inventory: {
type: 'string',
'x-component-props': {
placeholder: '请选择对应仓库',
style: {
width: 160,
},
},
enum: [],
},
state: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据状态',
style: {
width: 160,
},
},
enum: [],
},
time: {
type: 'string',
'x-component-props': {
placeholder: '请选择交易时间',
style: {
width: 160,
},
},
enum: [],
},
},
},
},
},
},
};
export const searchSchema: ISchema = {
type: 'object',
properties: {
searchWrap: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
actions: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{Actions}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 仓库名称 进行搜索',
advanced: false,
},
},
},
},
},
};
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from 'umi';
const intl = getIntl();
export const warehouseSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
properties: {
invoicesNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuhao'}),
style: {
width: 160,
},
},
},
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
style: {
width: 160,
},
},
},
orderNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
style: {
width: 160,
},
},
},
invoicesType: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuleixing'}),
style: {
width: 160,
},
},
enum: [],
},
inventory: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzeduiyingcangku'}),
style: {
width: 160,
},
},
enum: [],
},
state: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuzhuangtai'}),
style: {
width: 160,
},
},
enum: [],
},
time: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzejiaoyishijian'}),
style: {
width: 160,
},
},
enum: [],
},
},
},
},
},
},
};
export const searchSchema: ISchema = {
type: 'object',
properties: {
searchWrap: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
actions: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{Actions}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
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