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': '查看仓库',
}
......@@ -10,39 +10,40 @@ import {
ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts,
} from '@/constants/order';
import { getIntl } from 'umi';
const intl = getIntl();
/**
* 采购订单-弹窗表格列
*/
export const purchaseOrderColumns: any[] = [
{
title: '订单号',
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
dataIndex: 'supplyMembersName',
},
{
title: '下单时间',
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
......@@ -54,33 +55,33 @@ export const purchaseOrderColumns: any[] = [
*/
export const salesOrderColumns: any[] = [
{
title: '订单号',
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
dataIndex: 'createMemberName',
},
{
title: '下单时间',
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
......@@ -92,28 +93,28 @@ export const salesOrderColumns: any[] = [
*/
export const machiningWarehousingColumns = [
{
title: '通知单号',
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
dataIndex: 'summary',
},
{
title: '加工企业名称',
title: intl.formatMessage({id: 'stockSellStorage.jiagongqiyemingcheng'}),
align: 'center',
dataIndex: 'processName',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
......@@ -124,28 +125,28 @@ export const machiningWarehousingColumns = [
*/
export const machiningDeliveryColumns = [
{
title: '通知单号',
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
dataIndex: 'summary',
},
{
title: '供应会员',
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
dataIndex: 'supplierName',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
......@@ -157,31 +158,31 @@ export const machiningDeliveryColumns = [
export const getAfterSaleColumns = (isPurchaser?: boolean) => {
return [
{
title: '申请单号',
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanhao'}),
align: 'center',
dataIndex: 'applyNo',
},
{
title: '申请单摘要',
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhaiyao'}),
align: 'center',
dataIndex: 'applyAbstract',
},
isPurchaser ? {
title: '供应会员',
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
dataIndex: 'supplierName',
} : {
title: '采购会员',
title: intl.formatMessage({id: 'stockSellStorage.caigouhuiyuan'}),
align: 'center',
dataIndex: 'consumerName',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
dataIndex: 'applyTime',
},
{
title: '申请单状态',
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
dataIndex: 'outerStatusName',
},
......
......@@ -61,8 +61,9 @@ import {
getExchangeDeliveryList,
getExchangeWarehousingList,
} from '../fetchBillList';
import { getIntl } from '@/.umi/plugin-locale/localeExports';
const intl = getIntl();
const {
onFieldInputChange$,
onFieldValueChange$,
......@@ -72,7 +73,7 @@ const {
const getParams = type => {
const basicParams = {
modalProps: {
title: '标题',
title: intl.formatMessage({id: 'stockSellStorage.biaoti'}),
},
columns: [],
fetchTableData: undefined,
......@@ -104,7 +105,7 @@ const getParams = type => {
switch (type) {
// 采购入库单
case DOC_TYPE_PURCHASE_RECEIPT: {
basicParams.modalProps.title = '选择订单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzedingdan'});
basicParams.columns = purchaseOrderColumns;
basicParams.fetchTableData = fetchOrderPurchaseReceiptAddList;
basicParams.formilyProps.ctx.schema = purchaseOrderBillSchema;
......@@ -113,7 +114,7 @@ const getParams = type => {
// 销售发货单
case DOC_TYPE_SALES_INVOICE: {
basicParams.modalProps.title = '选择订单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzedingdan'});
basicParams.columns = salesOrderColumns;
basicParams.fetchTableData = getOrderSalesInvoiceOrderList;
basicParams.formilyProps.ctx.schema = purchaseOrderBillSchema; // 这里用同一个 schema 是因为接口参数名是一样的,后台做了处理
......@@ -122,7 +123,7 @@ const getParams = type => {
// 加工入库单
case DOC_TYPE_PROCESS_RECEIPT: {
basicParams.modalProps.title = '选择生产通知单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshengchantongzhidan'});
basicParams.columns = machiningWarehousingColumns;
basicParams.fetchTableData = getMachiningWarehousingList;
basicParams.formilyProps.ctx.schema = machiningWarehousingBillSchema;
......@@ -131,7 +132,7 @@ const getParams = type => {
// 加工发货单
case DOC_TYPE_PROCESS_INVOICE: {
basicParams.modalProps.title = '选择生产通知单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshengchantongzhidan'});
basicParams.columns = machiningDeliveryColumns;
basicParams.fetchTableData = getMachiningDeliveryList;
basicParams.formilyProps.ctx.schema = machiningDeliveryBillSchema;
......@@ -140,7 +141,7 @@ const getParams = type => {
// 退货发货单
case DOC_TYPE_RETURN_INVOICE: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getRefundDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
......@@ -149,7 +150,7 @@ const getParams = type => {
// 退货入库单
case DOC_TYPE_RETURN_RECEIPT: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getRefundWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
......@@ -158,7 +159,7 @@ const getParams = type => {
// 换货退货发货单
case DOC_TYPE_EXCHANGE_RETURN_INVOICE: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeReturnDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
......@@ -167,7 +168,7 @@ const getParams = type => {
// 换货退货入库单
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeReturnWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
......@@ -176,7 +177,7 @@ const getParams = type => {
// 换货发货单
case DOC_TYPE_EXCHANGE_INVOICE: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
......@@ -185,7 +186,7 @@ const getParams = type => {
// 换货入库单
case DOC_TYPE_EXCHANGE_RECEIPT: {
basicParams.modalProps.title = '选择售后单';
basicParams.modalProps.title = intl.formatMessage({id: 'stockSellStorage.xuanzeshouhoudan'});
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
......@@ -500,7 +501,7 @@ export const useBusinessEffects = (context, actions) => {
data = [],
} = res.data;
const goodOptions = data.map(item => ({
label: `${item.productName}---订单号:${item.orderNo}`,
label: `${item.productName}---${intl.formatMessage({id: 'stockSellStorage.dingdanhao'})}${item.orderNo}`,
value: item.orderRecordId,
}));
setFieldState('invoicesDetailsRequests.*.product', state => {
......@@ -557,7 +558,7 @@ export const useBusinessEffects = (context, actions) => {
// 这里判断是否货品 跟 商品 都已经选择过了,不可重复选择
const sameGood = invoicesDetailsRequestsValue.find((item, index) => index !== +itemIndex && item.itemNo === itemNoValue && item.product === value);
if (sameGood) {
message.warning('存在相同货号+商品的组合,请重新选择');
message.warning(intl.formatMessage({id: 'stockSellStorage.cunzaixiangtonghuohaoshang'}));
setTimeout(() => {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
......@@ -715,7 +716,7 @@ export const useBusinessEffects = (context, actions) => {
current.logistics &&
invoicesDetailsRequestsValue.some(item => item.extraData && item.extraData.deliveryType !== current.logistics.deliveryType)
) {
state.errors = '商品配送方式不一致,请保持一次性';
state.errors = intl.formatMessage({id: 'stockSellStorage.shangpinpeisongfangshibuyi'});
} else {
state.errors = '';
}
......@@ -842,10 +843,10 @@ export const useBusinessEffects = (context, actions) => {
if (current && +value > current.purchaseCount) {
Modal.destroyAll();
Modal.confirm({
title: '提示',
content: '单据数量已超过商品数量',
okText: '确认',
cancelText: '取消',
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguoshang'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
});
}
break;
......@@ -857,10 +858,10 @@ export const useBusinessEffects = (context, actions) => {
if (current && +value > current.processNum) {
Modal.destroyAll();
Modal.confirm({
title: '提示',
content: '单据数量已超过加工数量',
okText: '确认',
cancelText: '取消',
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguojia'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
......@@ -882,10 +883,10 @@ export const useBusinessEffects = (context, actions) => {
if (current && +value > current.replaceCount) {
Modal.destroyAll();
Modal.confirm({
title: '提示',
content: '单据数量已超过换货数量',
okText: '确认',
cancelText: '取消',
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguohuan'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
......@@ -903,10 +904,10 @@ export const useBusinessEffects = (context, actions) => {
if (current && +value > current.returnCount) {
Modal.destroyAll();
Modal.confirm({
title: '提示',
content: '单据数量已超过退货数量',
okText: '确认',
cancelText: '取消',
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguotui'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
import { Button, Card, Spin, message } from 'antd';
import { DeleteOutlined } from '@ant-design/icons';
import { Radio, ArrayTable } from '@formily/antd-components';
import { history, Prompt } from 'umi';
import { getIntl, history, Prompt } from 'umi';
import moment from 'moment';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
......@@ -42,7 +42,7 @@ import {
import { addBillSchema, goodsSearchSchema } from './schema';
import { createEffects } from './effects';
import EllipsisText from '../EllipsisText';
const intl = getIntl();
const addSchemaAction = createFormActions();
const {
......@@ -110,35 +110,35 @@ const BillsForm: React.FC<BillsFormProps> = ({
}) => {
const [visible, setVisible] = useState(false);
const [productRowSelection, productRowCtl] = useRowSelectionTable({ type: 'checkbox' });
const [billInfo, setBillInfo] = useState<{[key: string]: any}>({ transactionTime: moment().format('YYYY-MM-DD HH:mm:ss') });
const [billInfo, setBillInfo] = useState<{ [key: string]: any }>({ transactionTime: moment().format('YYYY-MM-DD HH:mm:ss') });
const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const goodsColumns: any[] = [
{
title: '货号',
title: intl.formatMessage({ id: 'stockSellStorage.huohao' }),
dataIndex: 'id',
align: 'center',
render: (_, record) => record.code,
},
{
title: '货品名称',
title: intl.formatMessage({ id: 'stockSellStorage.huopinmingcheng' }),
dataIndex: 'name',
align: 'center',
},
{
title: '规格型号',
title: intl.formatMessage({ id: 'stockSellStorage.guigexinghao' }),
dataIndex: 'type',
align: 'center',
},
{
title: '品类',
title: intl.formatMessage({ id: 'stockSellStorage.pinlei' }),
dataIndex: ['customerCategory', 'name'],
align: 'center',
},
{
title: '品牌',
title: intl.formatMessage({ id: 'stockSellStorage.pinpai' }),
dataIndex: ['brand', 'name'],
align: 'center',
},
......@@ -773,7 +773,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const orderNoVal = addSchemaAction.getFieldValue('orderNo');
const relevanceInvoicesVal = addSchemaAction.getFieldValue('relevanceInvoices');
if (!orderNoVal && relevanceInvoicesVal !== DEPENDENT_DOC_INTERNAL) {
message.warning('请选择对应单据');
message.warning(intl.formatMessage({ id: 'stockSellStorage.qingxuanzeduiyingdanju' }));
return;
}
setVisible(true);
......@@ -787,7 +787,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
onClick={handleAdd}
type="dashed"
>
添加单据明细
{intl.formatMessage({ id: 'stockSellStorage.tianjiadanjumingxi' })}
</Button>
) : null;
......@@ -1848,13 +1848,13 @@ const BillsForm: React.FC<BillsFormProps> = ({
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'stockSellStorage.fanhui' })} />}
title={
!id && isEdit ?
'新建单据' :
intl.formatMessage({ id: 'stockSellStorage.xinjiandanju' }) :
isEdit ?
'编辑单据' :
'查看单据'
intl.formatMessage({ id: 'stockSellStorage.bianjidanju' }) :
intl.formatMessage({ id: 'stockSellStorage.zhakandanju' })
}
extra={
(isEdit)
......@@ -1866,7 +1866,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
loading={submitLoading}
onClick={() => addSchemaAction.submit()}
>
保存
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>,
]
: []
......@@ -1901,7 +1901,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
</Card>
<ModalTable
modalTitle='选择货品'
modalTitle={intl.formatMessage({id: 'stockSellStorage.xuanzehuopin'})}
confirm={handleOkAddProduct}
cancel={() => setVisible(false)}
visible={visible}
......@@ -1960,7 +1960,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
}}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})} />
</PageHeaderWrapper>
</Spin>
);
......
......@@ -34,9 +34,10 @@ import { createEffects } from './effects';
import { RelatedInfoDataType, RelatedInfoType, BillSubmitValuesType } from './interface';
import { normalizeBillDetails } from './utils';
import EllipsisText from '../EllipsisText';
import { getIntl } from 'umi';
export * from './interface';
const intl = getIntl();
const TITLE_MAP = {
[DOC_TYPE_PURCHASE_RECEIPT]: '采购入库单',
[DOC_TYPE_SALES_INVOICE]: '销售发货单',
......@@ -120,11 +121,11 @@ const BillsFormPage: React.FC<IProps> = (props: IProps) => {
const anchorsArr = [
{
key: 'basicInfo',
name: '基本信息',
name: intl.formatMessage({id: 'stockSellStorage.jibenxinxi'}),
},
{
key: 'billDetail',
name: '单据明细',
name: intl.formatMessage({id: 'stockSellStorage.danjumingxi'}),
},
];
......@@ -135,7 +136,7 @@ const BillsFormPage: React.FC<IProps> = (props: IProps) => {
return (
<Spin spinning={relatedLoading}>
<AnchorPage
title={`${editable ? '新增' : '查看'}${TITLE_MAP[billType]}`}
title={`${editable ? intl.formatMessage({id: 'stockSellStorage.xinzeng'}) : intl.formatMessage({id: 'stockSellStorage.zhakan'})}${TITLE_MAP[billType]}`}
anchors={anchorsArr}
extra={(
<>
......@@ -145,7 +146,7 @@ const BillsFormPage: React.FC<IProps> = (props: IProps) => {
loading={!!submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>
) : null}
</>
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button, Card, Dropdown, Menu, Space, Badge, Popconfirm } from 'antd';
import { PlusOutlined, DownOutlined, DeleteOutlined, RollbackOutlined, SnippetsOutlined, ZoomOutOutlined } from '@ant-design/icons';
......@@ -16,7 +16,7 @@ import UploadModal from '@/components/UploadModal';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { DOC_STATUS_UNREVIEWED, DOC_STATUS_REVIEWED, DOC_STATUS } from '@/constants/commodity';
import { billsSchema } from './schema';
const intl = getIntl();
const formActions = createFormActions();
const Bills: React.FC<{}> = () => {
......@@ -142,16 +142,16 @@ const Bills: React.FC<{}> = () => {
const menu = (
<Menu onClick={e => handleBatch(e.key)}>
<Menu.Item key="DeleteBatch" icon={<ZoomOutOutlined />}>
删除导入批次
{intl.formatMessage({id: 'stockSellStorage.shanchudaorupici'})}
</Menu.Item>
<Menu.Item key="BatchDelete" icon={<DeleteOutlined />}>
批量删除
{intl.formatMessage({id: 'stockSellStorage.piliangshanchu'})}
</Menu.Item>
<Menu.Item key="BatchAudit" icon={<SnippetsOutlined />}>
批量审核
{intl.formatMessage({id: 'stockSellStorage.piliangshenhe'})}
</Menu.Item>
<Menu.Item key="BatchCounterclaim" icon={<RollbackOutlined />}>
批量反审
{intl.formatMessage({id: 'stockSellStorage.piliangfanshen'})}
</Menu.Item>
</Menu>
);
......@@ -179,7 +179,7 @@ const Bills: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: '单据号',
title: intl.formatMessage({id: 'stockSellStorage.danjuhao'}),
dataIndex: 'invoicesNo',
align: 'center',
render: (text: any, record: any) => (
......@@ -191,39 +191,39 @@ const Bills: React.FC<{}> = () => {
),
},
{
title: '单据类型',
title: intl.formatMessage({id: 'stockSellStorage.danjuleixing'}),
align: 'center',
dataIndex: 'invoicesType',
},
{
title: '单据摘要',
title: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
align: 'center',
dataIndex: 'invoicesAbstract',
ellipsis: true,
},
{
title: '会员名称',
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
dataIndex: 'memberName',
},
{
title: '对应仓库',
title: intl.formatMessage({id: 'stockSellStorage.duiyingcangku'}),
align: 'center',
dataIndex: 'inventory',
},
{
title: '交易时间',
title: intl.formatMessage({id: 'stockSellStorage.jiaoyishijian'}),
align: 'center',
dataIndex: 'transactionTime',
render: text => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: '订单号',
title: intl.formatMessage({id: 'stockSellStorage.dingdanhao'}),
align: 'center',
dataIndex: 'orderNo',
},
{
title: '单据状态',
title: intl.formatMessage({id: 'stockSellStorage.danjuzhuangtai'}),
align: 'center',
dataIndex: 'state',
filters: [
......@@ -240,7 +240,7 @@ const Bills: React.FC<{}> = () => {
),
},
{
title: '操作',
title: intl.formatMessage({id: 'stockSellStorage.caozuo'}),
dataIndex: 'actions',
align: 'center',
render: (_, record: any) => {
......@@ -248,25 +248,25 @@ const Bills: React.FC<{}> = () => {
<>
{record.state === DOC_STATUS_UNREVIEWED && (
<>
<Button type="link" onClick={() => history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/edit?id=${record.id}`)}>修改</Button>
<Button type="link" onClick={() => handleAudit(record.id)}>审核</Button>
<Button type="link" onClick={() => history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/edit?id=${record.id}`)}>{intl.formatMessage({id: 'stockSellStorage.xiugai'})}</Button>
<Button type="link" onClick={() => handleAudit(record.id)}>{intl.formatMessage({id: 'stockSellStorage.shenhe'})}</Button>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
title={intl.formatMessage({id: 'stockSellStorage.quedingyaoshanchuma'})}
okText={intl.formatMessage({id: 'stockSellStorage.shi'})}
cancelText={intl.formatMessage({id: 'stockSellStorage.fou'})}
onConfirm={() => handleDelete(record.id)}
>
<Button
type="link"
danger
>
删除
{intl.formatMessage({id: 'stockSellStorage.shanchu'})}
</Button>
</Popconfirm>
</>
)}
{record.state === DOC_STATUS_REVIEWED && (
<Button type="link" onClick={() => handleCounterclaim(record.id)}>反审</Button>
<Button type="link" onClick={() => handleCounterclaim(record.id)}>{intl.formatMessage({id: 'stockSellStorage.fanshen'})}</Button>
)}
</>
) : null;
......@@ -292,15 +292,15 @@ const Bills: React.FC<{}> = () => {
)
}
>
新建
{intl.formatMessage({id: 'stockSellStorage.xinjian'})}
</Button>
<Button onClick={() => setVisibleModal(true)}>导入</Button>
<Button onClick={() => setVisibleModal(true)}>{intl.formatMessage({id: 'stockSellStorage.daoru'})}</Button>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
{intl.formatMessage({id: 'stockSellStorage.gengduo'})}
</Dropdown.Button>
</Space>
);
......@@ -337,7 +337,7 @@ const Bills: React.FC<{}> = () => {
/>
<UploadModal
visibleModal={visibleModal}
fileText="单据资料"
fileText={intl.formatMessage({id: 'stockSellStorage.danjuziliao'})}
onCancel={() => setVisibleModal(false)}
/>
</Card>
......
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: {
......@@ -27,8 +28,8 @@ export const billsSchema: ISchema = {
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
tip: '输入 单据号 进行搜索',
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: intl.formatMessage({id: 'stockSellStorage.shurudanjuhao'})
},
},
},
......@@ -48,7 +49,7 @@ export const billsSchema: ISchema = {
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: '单据摘要',
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
style: {
width: 160,
},
......@@ -57,7 +58,7 @@ export const billsSchema: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
style: {
width: 160,
},
......@@ -66,7 +67,7 @@ export const billsSchema: ISchema = {
orderNo: {
type: 'string',
'x-component-props': {
placeholder: '订单号',
placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
style: {
width: 160,
},
......@@ -75,7 +76,7 @@ export const billsSchema: ISchema = {
invoicesTypeId: {
type: 'string',
'x-component-props': {
placeholder: '单据类型',
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuleixing'}),
allowClear: true,
style: {
width: 160,
......@@ -86,7 +87,7 @@ export const billsSchema: ISchema = {
inventory: {
type: 'string',
'x-component-props': {
placeholder: '对应仓库',
placeholder: intl.formatMessage({id: 'stockSellStorage.duiyingcangku'}),
allowClear: true,
style: {
width: 160,
......@@ -98,7 +99,7 @@ export const billsSchema: ISchema = {
type: 'string',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间',
placeholder: intl.formatMessage({id: 'stockSellStorage.jiaoyishijian'}),
allowClear: true,
style: {
width: 160,
......@@ -111,7 +112,7 @@ export const billsSchema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
},
},
},
......
import React, { useState, useEffect } from 'react';
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 { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
......@@ -20,7 +20,7 @@ interface BillTypeFormProps {
// 是否是编辑的
isEdit?: boolean;
};
const intl = getIntl();
const BillTypeForm: React.FC<BillTypeFormProps> = ({
id,
isEdit = false,
......@@ -90,13 +90,13 @@ const BillTypeForm: React.FC<BillTypeFormProps> = ({
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
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)
......@@ -108,7 +108,7 @@ const BillTypeForm: React.FC<BillTypeFormProps> = ({
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>,
]
: []
......@@ -131,7 +131,7 @@ const BillTypeForm: React.FC<BillTypeFormProps> = ({
schema={billsTypeDetailSchema}
/>
</Card>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})}/>
</PageHeaderWrapper>
</Spin>
);
......
......@@ -7,7 +7,8 @@
*/
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: {
......@@ -22,29 +23,29 @@ export const billsTypeDetailSchema: ISchema = {
properties: {
number: {
type: 'string',
title: '单据类型编号',
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingbianhao' }),
'x-component-props': {
placeholder: '最长10个字符',
placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang10gezifu' }),
maxLength: 10,
},
'x-rules': [
{
required: true,
message: '请输入单据类型编号',
message: intl.formatMessage({ id: 'stockSellStorage.qingshurudanjuleixingbian' }),
},
{
validator: value => {
const CNReg = /[\u4E00-\u9FA5]/g;
return CNReg.test(value) ? '请输入非中文字符,可以是字母 + 数字 + 字符的组合' : '';
return CNReg.test(value) ? intl.formatMessage({ id: 'stockSellStorage.qingshurufeizhongwenzifu' }) : '';
},
},
],
},
name: {
type: 'string',
title: '单据类型名称',
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingmingcheng' }),
'x-component-props': {
placeholder: '最长20个字符,10个汉字',
placeholder: intl.formatMessage({ id: 'stockSellStorage.zuichang20gezifu10ge' }),
},
required: true,
'x-rules': [
......@@ -56,7 +57,7 @@ export const billsTypeDetailSchema: ISchema = {
},
direction: {
type: 'string',
title: '单据类型方向',
title: intl.formatMessage({id: 'stockSellStorage.danjuleixingfangxiang'}),
enum: [
{
label: DOC_DIRECTION[DOC_DIRECTION_WAREHOUSING],
......@@ -68,7 +69,7 @@ export const billsTypeDetailSchema: ISchema = {
},
],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'stockSellStorage.qingxuanze' }),
},
required: true,
},
......
import React, { useRef } from 'react';
import { history } from 'umi';
import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
Button,
......@@ -17,7 +17,7 @@ import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { DOC_TYPE_STATUS_EFFECTIVE, DOC_TYPE_STATUS_INVALID, DOC_DIRECTION } from '@/constants/commodity';
import { searchSchema } from './schema';
const intl = getIntl();
const formActions = createFormActions();
const billsType: React.FC<{}> = () => {
......@@ -30,12 +30,12 @@ const billsType: React.FC<{}> = () => {
align: 'center',
},
{
title: '单据类型编号',
title: intl.formatMessage({id: 'stockSellStorage.danjuleixingbianhao'}),
dataIndex: 'number',
align: 'center',
},
{
title: '单据名称',
title: intl.formatMessage({id: 'stockSellStorage.danjumingcheng'}),
dataIndex: 'name',
align: 'center',
render: (text: any, record: any) => {
......@@ -49,7 +49,7 @@ const billsType: React.FC<{}> = () => {
},
},
{
title: '方向',
title: intl.formatMessage({id: 'stockSellStorage.fangxiang'}),
dataIndex: 'direction',
align: 'center',
render: text => {
......@@ -57,7 +57,7 @@ const billsType: React.FC<{}> = () => {
},
},
{
title: '状态',
title: intl.formatMessage({id: 'stockSellStorage.zhuangtai'}),
dataIndex: 'status',
align: 'center',
sorter: (a, b) => a.state - b.state,
......@@ -70,7 +70,7 @@ const billsType: React.FC<{}> = () => {
),
},
{
title: '操作',
title: intl.formatMessage({id: 'stockSellStorage.caozuo'}),
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => (
......@@ -85,15 +85,15 @@ const billsType: React.FC<{}> = () => {
)
}
>
编辑
{intl.formatMessage({id: 'stockSellStorage.bianji'})}
</Button>
<Popconfirm
title="确定要删除该单据类型吗?"
title={intl.formatMessage({id: 'stockSellStorage.quedingyaoshanchugaidanju'})}
onConfirm={() => handleDelete(record)}
okText="是"
cancelText="否"
okText={intl.formatMessage({id: 'stockSellStorage.shi'})}
cancelText={intl.formatMessage({id: 'stockSellStorage.fou'})}
>
<Button type="link" danger>删除</Button>
<Button type="link" danger>{intl.formatMessage({id: 'stockSellStorage.shanchu'})}</Button>
</Popconfirm>
</>
)}
......@@ -149,7 +149,7 @@ const billsType: React.FC<{}> = () => {
icon={<PlusOutlined />}
onClick={handleJumpAdd}
>
新建
{intl.formatMessage({id: 'stockSellStorage.xinjian'})}
</Button>
</Space>
);
......
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const searchSchema: ISchema = {
type: 'object',
properties: {
......@@ -21,9 +22,9 @@ export const searchSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
advanced: false,
tip: '输入 单据名称 进行搜索',
tip: intl.formatMessage({id: 'stockSellStorage.shurudanjumingcheng'}),
},
},
},
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Input, Card, Space, Modal } from 'antd';
import {
......@@ -19,7 +19,7 @@ import styles from './index.less';
const formActions = createFormActions();
const modalFormActions = createFormActions();
const intl = getIntl();
const Inventory: React.FC<{}> = () => {
const [current, setCurrent] = useState(null);
const [modalVisible, setModalVisible] = useState(false);
......@@ -34,54 +34,54 @@ const Inventory: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: '货号',
title: intl.formatMessage({ id: 'stockSellStorage.huohao' }),
align: 'center',
dataIndex: 'itemNo',
},
{
title: '货品名称',
title: intl.formatMessage({ id: 'stockSellStorage.huopinmingcheng' }),
dataIndex: 'goodsName',
align: 'center',
render: (text: any, record: any) => text,
},
{
title: '规格型号',
title: intl.formatMessage({ id: 'stockSellStorage.guigexinghao' }),
dataIndex: 'specifications',
align: 'center',
},
{
title: '品类',
title: intl.formatMessage({ id: 'stockSellStorage.pinlei' }),
dataIndex: 'category',
align: 'center',
},
{
title: '品牌',
title: intl.formatMessage({ id: 'stockSellStorage.pinpai' }),
dataIndex: 'brand',
align: 'center',
},
{
title: '单位',
title: intl.formatMessage({ id: 'stockSellStorage.danwei' }),
dataIndex: 'unit',
align: 'center',
},
{
title: '成本价',
title: intl.formatMessage({ id: 'stockSellStorage.chengbenjia' }),
dataIndex: 'costPrice',
align: 'center',
render: text => ${text}`
},
{
title: '仓库',
title: intl.formatMessage({ id: 'stockSellStorage.cangku' }),
dataIndex: 'warehouse',
align: 'center',
},
{
title: '库存',
title: intl.formatMessage({id: 'stockSellStorage.kucun'}),
dataIndex: 'inventory',
align: 'center',
},
{
title: '金额',
title: intl.formatMessage({ id: 'stockSellStorage.jine' }),
dataIndex: 'price',
align: 'center',
render: text => ${text}`
......@@ -89,7 +89,7 @@ const Inventory: React.FC<{}> = () => {
{
title: (
<Space>
安全库存
{intl.formatMessage({id: 'stockSellStorage.anquankucun'})}
<SettingOutlined />
</Space>
),
......@@ -173,7 +173,7 @@ const Inventory: React.FC<{}> = () => {
</Card>
<Modal
title="调整安全库存"
title={intl.formatMessage({id: 'stockSellStorage.tiaozhenganquankucun'})}
visible={modalVisible}
confirmLoading={confirmLoading}
onOk={() => modalFormActions.submit()}
......
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: {
......@@ -14,8 +15,8 @@ export const inventorySchema: ISchema = {
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
tip: '输入 货品名称 进行搜索',
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: intl.formatMessage({id: 'stockSellStorage.shuruhuopinmingcheng'}),
align: 'flex-left',
},
},
......@@ -32,31 +33,31 @@ export const inventorySchema: ISchema = {
itemNo: {
type: 'string',
'x-component-props': {
placeholder: '货号',
placeholder: intl.formatMessage({id: 'stockSellStorage.huohao'}),
},
},
specifications: {
type: 'string',
'x-component-props': {
placeholder: '规格型号',
placeholder: intl.formatMessage({id: 'stockSellStorage.guigexinghao'}),
},
},
category: {
type: 'string',
'x-component-props': {
placeholder: '品类',
placeholder: intl.formatMessage({id: 'stockSellStorage.pinlei'}),
},
},
brand: {
type: 'string',
'x-component-props': {
placeholder: '品牌',
placeholder: intl.formatMessage({id: 'stockSellStorage.pinpai'}),
},
},
warehouseId: {
type: 'string',
'x-component-props': {
placeholder: '仓库',
placeholder: intl.formatMessage({id: 'stockSellStorage.cangku'}),
},
enum: [],
},
......@@ -66,7 +67,7 @@ export const inventorySchema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
},
},
},
......@@ -88,15 +89,15 @@ export const safetyModalSchema: ISchema = {
properties: {
safetyInvoices: {
type: 'string',
title: '安全库存',
title: intl.formatMessage({id: 'stockSellStorage.anquankucun'}),
required: true,
'x-component-props': {
placeholder: '请输入',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuru'}),
},
'x-rules': [
{
pattern: PATTERN_MAPS.weight,
message: '请输入正数',
message: intl.formatMessage({id: 'stockSellStorage.qingshuruzhengshu'}),
},
],
},
......
import React, { useState, useEffect } from 'react';
import { history, Prompt } from 'umi';
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';
......@@ -13,7 +13,7 @@ import { getManageAreaAll, getManageCountryAreaGetTelCode } from '@/services/Man
import { getProductWarehouseDetails, postProductWarehouseAdd, postProductWarehouseUpdate } from '@/services/ProductV2Api';
import styles from './index.less';
const intl = getIntl();
const formActions = createFormActions();
const {
onFormInputChange$,
......@@ -124,7 +124,7 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
const AddressLabel = (
<div className={styles.label}>
仓库地址
{intl.formatMessage({ id: 'stockSellStorage.cangkudizhi' })}
</div>
);
......@@ -135,13 +135,13 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'stockSellStorage.fanhui' })} />}
title={
!id ?
'新建仓库' :
intl.formatMessage({ id: 'stockSellStorage.xinjiancangku' }) :
isEdit ?
'编辑仓库' :
'查看仓库'
intl.formatMessage({ id: 'stockSellStorage.bianjicangku' }) :
intl.formatMessage({ id: 'stockSellStorage.zhakancangku' })
}
extra={
(isEdit || !id)
......@@ -153,7 +153,7 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>,
]
: []
......@@ -187,7 +187,7 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
/>
</Card>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})} />
</Spin>
);
};
......
import { ISchema } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from 'umi';
const intl = getIntl();
export const warehouseDetailSchema: ISchema = {
type: 'object',
properties: {
......@@ -15,14 +16,14 @@ export const warehouseDetailSchema: ISchema = {
properties: {
name: {
type: 'string',
title: '仓库名称',
title: intl.formatMessage({ id: 'stockSellStorage.cangkumingcheng' }),
'x-component-props': {
placeholder: '请输入',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuru'}),
},
'x-rules': [
{
required: true,
message: '请输入仓库名称',
message: intl.formatMessage({id: 'stockSellStorage.qingshurucangkumingcheng'}),
},
{
limitByte: true, // 自定义校验规则
......@@ -54,7 +55,7 @@ export const warehouseDetailSchema: ISchema = {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '- 省 -',
placeholder: intl.formatMessage({id: 'stockSellStorage.sheng'}),
},
'x-linkages': [
{
......@@ -70,7 +71,7 @@ export const warehouseDetailSchema: ISchema = {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '- 市 -',
placeholder: intl.formatMessage({id: 'stockSellStorage.shi1'}),
},
'x-linkages': [
{
......@@ -86,7 +87,7 @@ export const warehouseDetailSchema: ISchema = {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '- 县 / 区 -',
placeholder: intl.formatMessage({id: 'stockSellStorage.xianqu'}),
},
required: true,
},
......@@ -97,7 +98,7 @@ export const warehouseDetailSchema: ISchema = {
required: true,
'x-component': 'TextArea',
'x-component-props': {
placeholder: '请输入详细地址(最长50个字符,25个汉字)',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuruxiangxidizhi'}),
rows: 5,
},
'x-rules': [
......@@ -111,7 +112,7 @@ export const warehouseDetailSchema: ISchema = {
},
principal: {
type: 'string',
title: '仓库负责人',
title: intl.formatMessage({id: 'stockSellStorage.cangkufuzhairen'}),
'x-component-props': {},
'x-rules': [
{
......@@ -124,7 +125,7 @@ export const warehouseDetailSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: '联系电话',
label: intl.formatMessage({id: 'stockSellStorage.lianxidianhua'}),
wrapperCol: 24,
},
properties: {
......@@ -140,7 +141,7 @@ export const warehouseDetailSchema: ISchema = {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanze'}),
},
},
tel: {
......@@ -149,13 +150,13 @@ export const warehouseDetailSchema: ISchema = {
span: 3,
},
'x-component-props': {
placeholder: '请输入你的手机号码',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshurunideshoujihao'}),
maxLength: 11,
},
'x-rules': [
{
pattern: PATTERN_MAPS.phone,
message: '请输入正确格式的手机号',
message: intl.formatMessage({id: 'stockSellStorage.qingshuruzhengquegeshide'}),
},
],
},
......
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
Button,
......@@ -18,7 +18,7 @@ import NiceForm from '@/components/NiceForm';
import { POSITION_STATUS_EFFECTIVE, POSITION_STATUS_INVALID } from '@/constants/commodity';
import { searchSchema } from './schema';
import style from './index.less';
const intl = getIntl();
const formActions = createFormActions();
const WareHouse: React.FC<{}> = () => {
......@@ -31,7 +31,7 @@ const WareHouse: React.FC<{}> = () => {
align: 'center',
},
{
title: '仓库名称',
title: intl.formatMessage({ id: 'stockSellStorage.cangkumingcheng' }),
dataIndex: 'name',
align: 'center',
render: (text: any, record: any) => {
......@@ -45,22 +45,22 @@ const WareHouse: React.FC<{}> = () => {
},
},
{
title: '仓库地址',
title: intl.formatMessage({id: 'stockSellStorage.cangkudizhi'}),
dataIndex: 'address',
align: 'center',
},
{
title: '仓库负责人',
title: intl.formatMessage({id: 'stockSellStorage.cangkufuzhairen'}),
dataIndex: 'principal',
align: 'center',
},
{
title: '联系电话',
title: intl.formatMessage({id: 'stockSellStorage.lianxidianhua'}),
dataIndex: 'tel',
align: 'center',
},
{
title: '状态',
title: intl.formatMessage({id: 'stockSellStorage.zhuangtai'}),
dataIndex: 'state',
align: 'center',
sorter: (a, b) => a.state - b.state,
......@@ -75,7 +75,7 @@ const WareHouse: React.FC<{}> = () => {
},
},
{
title: '操作',
title: intl.formatMessage({id: 'stockSellStorage.caozuo'}),
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => (
......@@ -90,15 +90,15 @@ const WareHouse: React.FC<{}> = () => {
)
}
>
编辑
{intl.formatMessage({id: 'stockSellStorage.bianji'})}
</Button>
<Popconfirm
title="确定要删除该仓位吗?"
title={intl.formatMessage({id: 'stockSellStorage.quedingyaoshanchugaicangwei'})}
onConfirm={() => handleDelete(record)}
okText="是"
cancelText="否"
okText={intl.formatMessage({id: 'stockSellStorage.shi'})}
cancelText={intl.formatMessage({id: 'stockSellStorage.fou'})}
>
<Button type="link" danger>删除</Button>
<Button type="link" danger>{intl.formatMessage({id: 'stockSellStorage.shanchu'})}</Button>
</Popconfirm>
</>
)}
......@@ -154,7 +154,7 @@ const WareHouse: React.FC<{}> = () => {
icon={<PlusOutlined />}
onClick={handleJumpAdd}
>
新建
{intl.formatMessage({id: 'stockSellStorage.xinjian'})}
</Button>
</Space>
);
......
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: {
......@@ -14,7 +15,7 @@ export const warehouseSchema: ISchema = {
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
},
},
[FORM_FILTER_PATH]: {
......@@ -28,7 +29,7 @@ export const warehouseSchema: ISchema = {
invoicesNo: {
type: 'string',
'x-component-props': {
placeholder: '单据号',
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuhao'}),
style: {
width: 160,
},
......@@ -37,7 +38,7 @@ export const warehouseSchema: ISchema = {
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: '单据摘要',
placeholder: intl.formatMessage({id: 'stockSellStorage.danjuzhaiyao'}),
style: {
width: 160,
},
......@@ -46,7 +47,7 @@ export const warehouseSchema: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
placeholder: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
style: {
width: 160,
},
......@@ -55,7 +56,7 @@ export const warehouseSchema: ISchema = {
orderNo: {
type: 'string',
'x-component-props': {
placeholder: '订单号',
placeholder: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
style: {
width: 160,
},
......@@ -64,7 +65,7 @@ export const warehouseSchema: ISchema = {
invoicesType: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据类型',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuleixing'}),
style: {
width: 160,
},
......@@ -74,7 +75,7 @@ export const warehouseSchema: ISchema = {
inventory: {
type: 'string',
'x-component-props': {
placeholder: '请选择对应仓库',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzeduiyingcangku'}),
style: {
width: 160,
},
......@@ -84,7 +85,7 @@ export const warehouseSchema: ISchema = {
state: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据状态',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzedanjuzhuangtai'}),
style: {
width: 160,
},
......@@ -94,7 +95,7 @@ export const warehouseSchema: ISchema = {
time: {
type: 'string',
'x-component-props': {
placeholder: '请选择交易时间',
placeholder: intl.formatMessage({id: 'stockSellStorage.qingxuanzejiaoyishijian'}),
style: {
width: 160,
},
......@@ -129,8 +130,8 @@ export const searchSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 仓库名称 进行搜索',
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