Commit 896fd1e3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理价格策略翻译影响添加功能,处理申请开票查看发票类型显示错误。

parent 887857e4
......@@ -4,7 +4,7 @@ import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin'
// import LodashModuleReplacementPlugin from 'lodash-webpack-plugin'
export default defineConfig({
devtool: false,
devtool: 'cheap-module-source-map',
// externals: {
// "react": 'React',
// "react-dom": 'ReactDOM',
......
......@@ -174,7 +174,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let _temp_attributeValObjArr = [] // 取id备用
let _attributeNameArr = []
let _attributeValueArr = []
if (hasAttribute.length) { // 提取价格属性 属性名数组 属性值SKU数组 /*编辑情况下直接进入此页面length为空 此时需获取调用接口返回的数据生成*/
hasAttribute.map(_item => {
_attributeNameArr.push(_item.attributeName) // 用于列header
......@@ -313,7 +312,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if (assistPrice && Array.isArray(assistPrice)) {
return assistPrice.map(p => <p>{planPrice === 3 ? p : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${p}`}</p>)
} else if (assistPrice) {
return planPrice === 3 ? assistPrice : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${assistPrice}`
return planPrice === 3 ? assistPrice : (isNaN(assistPrice) ? `¥${0.00}` : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${assistPrice}`)
}
}
})
......
import React, { useContext, useEffect, useState } from 'react'
import { useIntl } from 'umi';
import { Button, Col, Form, Input, Row, Select } from 'antd'
import { Button, Col, Form, Input, message, Row, Select } from 'antd'
import MellowCard from '@/components/MellowCard';
import { BIND_PHONE, EDetailContext, formItemLayout, formItemLayoutCompany, prefixSelector, prefixSelectorEle, tailFormItemLayout, tailFormItemLayoutCompany } from '../../constant';
import { EditOutlined } from '@ant-design/icons';
......@@ -90,17 +90,21 @@ const Company: React.FC<{}> = () => {
picture: values[item]
}))
const fns = pictures.map((item, index) => new Promise(() => {
setTimeout(() => postPayAllInPayIdCardCollect(item), 500 * index)
const fns = pictures.map((item, index) => new Promise((resolve, reject) => {
setTimeout(() => {
const res = postPayAllInPayIdCardCollect(item, {ctlType: "none"})
resolve(res)
}, 500 * index)
}))
Promise.all(fns).then(res => {
console.log(res)
}).finally(() => {
setTimeout(() => {
setLoading(false)
reloadFormData()
}, 2000)
Promise.all(fns).then((res) => {
if(res.every(item => item['code'] === 1000)) {
message.success('操作成功')
} else {
message.success('操作失败')
}
setLoading(false)
reloadFormData()
})
}
......
import { useIntl } from 'umi';
import { getIntl } from 'umi';
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { columnsUnitProduct } from '../constant';
import { GlobalConfig } from '@/global/config';
......@@ -33,7 +33,7 @@ export const searchCustomerCategoryOptionEffect = (context: any, fieldName: stri
// 构建设置价格 table 所需要的data和columns
export const constructTableData = (data: any, ctx: ISchemaFormActions | ISchemaFormAsyncActions, pageStatus: any) => {
const intl = useIntl();
const intl = getIntl();
let col: any = [...columnsUnitProduct]
let temp: any = []
// 兼容编辑价格策略 新增使用data 编辑使用data[0].commodityUnitPrice
......@@ -94,7 +94,7 @@ export const constructTableData = (data: any, ctx: ISchemaFormActions | ISchemaF
// 生成 Api 所需要的参数
export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const intl = useIntl();
const intl = getIntl();
let _params: any = {}
_params["name"] = data.name
_params["priceType"] = data.priceType
......
......@@ -264,7 +264,7 @@ const PriceModal: React.FC<PriceModalProps> = (props) => {
},
{
pattern: /^\d+(\.\d{1,4})?$/,
message: intl.formatMessage({ id: 'priceManage.priceStrategy.priceModal.uniquePrice.rule1' }),
message: intl.formatMessage({ id: 'priceManage.priceStrategy.priceModal.uniquePrice.rule.2' }),
}
]}
>
......
......@@ -234,8 +234,8 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
{/* 查看发票 */}
<Modal title={intl.formatMessage({id: 'transaction_components.fapiaoxinxi'})} visible={isModalVisible} onOk={()=>setIsModalVisible(false)} onCancel={()=>setIsModalVisible(false)}>
<Row gutter={[0 ,10]} style={{fontSize: 14}}>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.kaijuleixing'})}</Col><Col span={20}>{invoice?.invoiceKind === 1 ? intl.formatMessage({id: 'transaction_components.qiye'}) : intl.formatMessage({id: 'transaction_components.geren'})}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.fapiaozhonglei'})}</Col><Col span={20}>{invoice?.invoiceTypeName}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.kaijuleixing'})}</Col><Col span={20}>{invoice?.invoiceTypeName}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.fapiaozhonglei'})}</Col><Col span={20}>{invoice?.invoiceKindName}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.fapiaotaitou'})}</Col><Col span={20}>{invoice?.title}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.nashuihao'})}</Col><Col span={20}>{invoice?.taxNo}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>{intl.formatMessage({id: 'transaction_components.kaihuhang'})}</Col><Col span={20}>{invoice?.bank}</Col>
......@@ -262,7 +262,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
<div className={cx(style.invoice_list_item_content_tag, item.kind !== 1 ? style.special : '')}>{item.kind === 1 ? intl.formatMessage({id: 'transaction_components.zengzhishuiputongfapiao'}) : intl.formatMessage({id: 'transaction_components.zengzhishuizhuanyongfapiao'})}</div>
<div className={style.invoice_list_item_content_name}>
<span>{item.invoiceTitle}</span>
<span>({item.type === 1 ? intl.formatMessage({id: 'transaction_components.qiye'}) : intl.formatMessage({id: 'transaction_components.geren'})})</span>
<span>{item.type === 1 ? intl.formatMessage({id: 'transaction_components.qiye'}) : intl.formatMessage({id: 'transaction_components.geren'})}</span>
{
item.isDefault === 1 ? <div className={style.default}>{intl.formatMessage({id: 'transaction_components.moren'})}</div> :
<div className={style.set_default} onClick={e => handleSetDefault(item, e)}>{intl.formatMessage({id: 'transaction_components.sheweimoren'})}</div>
......
......@@ -112,6 +112,8 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
</Col>
</RowStyle>
})
/** 此文件模块 包含orderCollect文件夹备用 暂不起作用 */
// 采购订单详情页. 包含新增和编辑
const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
......@@ -161,23 +163,23 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
useEffect(() => {
if (id) {
setFormLoading(true)
// @ts-ignore
getOrderProcurementOrderDetails({
id
}).then(res => {
const { data } = res
const _orderProductRequests = data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests
setInitFormValue({
...data,
// 判断是否合同下单
orderProductRequests: [],
deliveryTime: formatTimeString(data.deliveryTime)
})
setTimeout(() => {
addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
}, 1000)
setFormLoading(false)
})
// // @ts-ignore
// getOrderProcurementOrderDetails({
// id
// }).then(res => {
// const { data } = res
// const _orderProductRequests = data.orderModel > 30 ? procurementRenderField(data.orderProductRequests) : data.orderProductRequests
// setInitFormValue({
// ...data,
// // 判断是否合同下单
// orderProductRequests: [],
// deliveryTime: formatTimeString(data.deliveryTime)
// })
// setTimeout(() => {
// addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
// }, 1000)
// setFormLoading(false)
// })
}
if (modelType) {
......
......@@ -61,7 +61,7 @@ import {
getExchangeDeliveryList,
getExchangeWarehousingList,
} from '../fetchBillList';
import { getIntl } from '@/.umi/plugin-locale/localeExports';
import { getIntl } from 'umi';
const intl = getIntl();
const {
......
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