Commit aeb0e849 authored by Bill's avatar Bill
parents 67911fde dcb1f0bd
......@@ -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}`)
}
}
})
......
......@@ -534,10 +534,10 @@ const Products: React.FC<{}> = () => {
setExportLoading(true)
postProductCommodityExportCommodityQrCode({idList: currentRef.current}, { responseType: 'blob', getResponse: true }).then((res:any) => {
const { code, data, response } = res
const filename = response.headers.get('content-disposition').split('=')[1]
if(code) {
throw new TypeError(res.message)
if(code !== 1000) {
throw new Error(res.message)
} else {
const filename = response.headers.get('content-disposition').split('=')[1]
let blob = new Blob([data], {type: "application/x-zip-compressed"})
// let objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
......@@ -547,7 +547,8 @@ const Products: React.FC<{}> = () => {
a.click();
window.URL.revokeObjectURL(url);
}
}).catch(error =>{
}).catch(error => {
console.log(error, 'error')
message.error(error)
}).finally(() => {
setExportLoading(false)
......
......@@ -268,6 +268,7 @@ const EAccountDetail: React.FC<{}> = () => {
modalRef.current.setVisible(false)
setSendCodeVisible(true)
setTradeCode(data.tradeCode)
start()
} else if(code === 1000 && parasm.type === 'GATEWAY_VSP') {
modalRef.current.setVisible(false)
setPayResultVisible(true)
......@@ -283,6 +284,7 @@ const EAccountDetail: React.FC<{}> = () => {
const handleRecharge = () => {
modalRef.current.setVisible(true)
}
const applyWithdraw = () => {
......@@ -291,11 +293,11 @@ const EAccountDetail: React.FC<{}> = () => {
}
const handleWithdraw = () => {
setLoading(true)
withdrawForm.submit()
}
const handleWidthdrawSubmit = (values) => {
setLoading(true)
const amount = Number(values.amount)
if (amount > 0 && amount <= details.usableBalance) { // 大于0并且小于可用金额
let params = {
......
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()
})
}
......
......@@ -103,7 +103,7 @@ const CompanyFinish: React.FC<{}> = () => {
</Col>
<Col span={12}>
<Row className={styles['card-list']}>
<Col span={6} className={styles['card-list_title']}>{intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.zhihanghanghao', defaultMessage: '支行号' })}</Col>
<Col span={6} className={styles['card-list_title']}>{intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.zhihanghanghao', defaultMessage: '支行号' })}</Col>
<Col>{data.bankNo}</Col>
</Row>
</Col>
......
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' }),
}
]}
>
......
......@@ -104,8 +104,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const payObj = data.payments.filter(item => item.showPayment)[0]
setCurrentPayInfoId(payObj?.paymentId ? payObj.paymentId : data.payments[0].paymentId)
}
} else {
message.error(msg)
}
})
}
......
......@@ -74,7 +74,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
name: 'invoice',
render: item => item && <div className={style.invoice_list_item}>
<div className={style.invoice_list_item_content}>
<div className={cx(style.invoice_list_item_content_tag, item.invoiceKind !== 1 ? style.special : '')}>{item.invoiceType === 1 ? intl.formatMessage({id: 'transaction_components.zengzhishuiputongfapiao'}) : intl.formatMessage({id: 'transaction_components.zengzhishuizhuanyongfapiao'})}</div>
<div className={cx(style.invoice_list_item_content_tag, item.invoiceKind !== 1 ? style.special : '')}>{item.invoiceKind === 1 ? intl.formatMessage({id: 'transaction_components.zengzhishuiputongfapiao'}) : intl.formatMessage({id: 'transaction_components.zengzhishuizhuanyongfapiao'})}</div>
<div className={style.invoice_list_item_content_name}>
<div>{item.title}</div>
<div>{item.taxNo}</div>
......@@ -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>
......
......@@ -384,6 +384,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setPayStep(3)
setTradeCode(res.data.tradeNo)
setCurrent(1000)
start()
} else if(tonglian && checked.id === 14) {
console.log(current, checked, '通联快捷跳转')
setCurrent(1000)
......
......@@ -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) {
......
......@@ -131,7 +131,6 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
effects={($, ctx) => {
$('onFormMount').subscribe(() => {
// 四级联动
console.log($, ctx, 1)
useChainEffects($, ctx)
})
......
......@@ -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