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

fix:处理报价类订单没有支付信息问题,新增销售订单内部状态0完成订单,修改账户充值微信渠道为2,处理渠道商品切换角色数据清空问题,处理快捷修改价格阶梯价格校验问题

parent 28c0ace3
...@@ -2,12 +2,13 @@ import React, { useState, useEffect } from 'react' ...@@ -2,12 +2,13 @@ import React, { useState, useEffect } from 'react'
import styles from './index.less' import styles from './index.less'
export interface ImagePreviewProps { export interface ImagePreviewProps {
src: string, src: any, // 图片src数组
currentRef?: any currentRef?: any
} }
const ImagePreview:React.FC<ImagePreviewProps> = ({src, currentRef}) => { const ImagePreview:React.FC<ImagePreviewProps> = ({src, currentRef}) => {
const [state, setState] = useState(false) const [state, setState] = useState(false)
const [index, setIndex] = useState(0)
useEffect(() => { useEffect(() => {
if (currentRef) { if (currentRef) {
...@@ -16,13 +17,16 @@ const ImagePreview:React.FC<ImagePreviewProps> = ({src, currentRef}) => { ...@@ -16,13 +17,16 @@ const ImagePreview:React.FC<ImagePreviewProps> = ({src, currentRef}) => {
} }
} }
}, []) }, [])
const toggle = () => { const toggle = (index?:any) => { // 点击的索引
if(index){
setIndex(index)
}
setState(!state) setState(!state)
} }
return state && ( return state && (
<div className={styles.imgPreviewWrapper} onClick={toggle}> <div className={styles.imgPreviewWrapper} onClick={toggle}>
<img src={src} className={styles.imgPreview}/> <img src={src[index]} className={styles.imgPreview}/>
</div> </div>
) )
} }
......
...@@ -881,6 +881,7 @@ export const PurchaseOrderTransformInsideWorkStateTexts = { ...@@ -881,6 +881,7 @@ export const PurchaseOrderTransformInsideWorkStateTexts = {
// 销售订单流转记录内部状态 // 销售订单流转记录内部状态
export const SaleOrderTransformInsideWorkStateTexts = { export const SaleOrderTransformInsideWorkStateTexts = {
"-1": '取消订单', "-1": '取消订单',
0: '完成订单',
1: '审核通过', 1: '审核通过',
2: '审核通过', 2: '审核通过',
3: '审核通过', 3: '审核通过',
......
...@@ -197,10 +197,6 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -197,10 +197,6 @@ const SelectChannel:React.FC<IProps> = (props) => {
message.error('请先选择渠道商品!') message.error('请先选择渠道商品!')
} }
const clickDelete = (record: any) => { // 删除处理
}
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
console.log(memberRowCtl.selectRow, memberRowCtl.selectedRowKeys, '选中的项') console.log(memberRowCtl.selectRow, memberRowCtl.selectedRowKeys, '选中的项')
...@@ -223,6 +219,8 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -223,6 +219,8 @@ const SelectChannel:React.FC<IProps> = (props) => {
setSelectedRole(option) setSelectedRole(option)
setMemberTableData([]) setMemberTableData([])
setSelectedMemberRowKeys([]) setSelectedMemberRowKeys([])
memberRowCtl.setSelectRow([])
memberRowCtl.setSelectedRowKeys([])
} }
const clickSearchChannel = (value: string) => { const clickSearchChannel = (value: string) => {
......
...@@ -223,12 +223,15 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => { ...@@ -223,12 +223,15 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<Form.Item <Form.Item
name={attrItem.id} name={attrItem.id}
label={attrItem.name} label={attrItem.name}
rules={attrItem.isEmpty && [{ rules={attrItem.isEmpty ? [{
required: true, required: true,
message: '此项为必填项' message: '此项为必填项'
},{ },{
validator: (r, v, c) => validatorByte(r, v, c, 60) validator: (r, v, c) => validatorByte(r, v, c, 60)
}]} }] : [{
validator: (r, v, c) => validatorByte(r, v, c, 60)
}]
}
> >
<TextArea <TextArea
disabled={_isDisabled} disabled={_isDisabled}
......
...@@ -30,17 +30,6 @@ interface Item { ...@@ -30,17 +30,6 @@ interface Item {
status: string; status: string;
} }
interface paramItem {
name: string;
code: string;
priceType: number;
min: number;
max: number;
brandId: number;
customerCategoryId: number;
status: number;
}
const FastModifyPrice: React.FC<{}> = () => { const FastModifyPrice: React.FC<{}> = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [setForm] = Form.useForm() const [setForm] = Form.useForm()
...@@ -198,7 +187,6 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -198,7 +187,6 @@ const FastModifyPrice: React.FC<{}> = () => {
const fetchData = (params: any) => { const fetchData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
//@ts-ignore
PublicApi.getProductCommodityGetCommodityDetailList({ ...filterParams, ...params, environment: 1 }).then(res => { PublicApi.getProductCommodityGetCommodityDetailList({ ...filterParams, ...params, environment: 1 }).then(res => {
const { data } = res const { data } = res
resolve(data) resolve(data)
...@@ -278,7 +266,6 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -278,7 +266,6 @@ const FastModifyPrice: React.FC<{}> = () => {
const handleOk = () => { const handleOk = () => {
setForm.validateFields().then(v=>{ setForm.validateFields().then(v=>{
console.log(v, 'v')
const { ladderPrice, ladderRange } = v const { ladderPrice, ladderRange } = v
let _priceRange = {} let _priceRange = {}
if(ladderPrice){ // 判断阶梯价格 if(ladderPrice){ // 判断阶梯价格
...@@ -288,8 +275,6 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -288,8 +275,6 @@ const FastModifyPrice: React.FC<{}> = () => {
}else{ }else{
_priceRange['0-0'] = v.uniquePrice _priceRange['0-0'] = v.uniquePrice
} }
console.log(_priceRange)
// @ts-ignore
PublicApi.postProductCommodityUpdateCommodityPrice({ id: currentRow.id, unitPrice: _priceRange }).then(res => { PublicApi.postProductCommodityUpdateCommodityPrice({ id: currentRow.id, unitPrice: _priceRange }).then(res => {
if(res.code === 1000){ if(res.code === 1000){
ref.current.reload() ref.current.reload()
...@@ -305,7 +290,9 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -305,7 +290,9 @@ const FastModifyPrice: React.FC<{}> = () => {
const changeLadderPrice = (e: any) => { const changeLadderPrice = (e: any) => {
setLadderPrice(e.target.checked) setLadderPrice(e.target.checked)
setForm.setFields([{name: 'ladderPrice', value: e.target.checked}]) if(e.target.checked && currentRow.minOrder){
setForm.setFieldsValue({ladderRange: [{numberPrice: null, numberRange: {numberMin: currentRow.minOrder, numberMax: null}}]})
}
} }
const handleHightSearch = (val?: string) => { const handleHightSearch = (val?: string) => {
...@@ -330,8 +317,9 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -330,8 +317,9 @@ const FastModifyPrice: React.FC<{}> = () => {
}, },
[] []
) )
let result = range.reduce((a, b) => { if(a<b) return b }) let result = range.map(Number).reduce((a, b) => { if(a<b) return b })
if(!result) throw new Error('请正确输入阶梯数量范围'); if(!result) throw new Error('请正确输入阶梯数量范围');
if(Number(range[0]) !== Number(currentRow.minOrder)) throw new Error('阶段的起始值必须为最小起订数');
callback() callback()
} }
} catch (err) { } catch (err) {
...@@ -483,8 +471,9 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -483,8 +471,9 @@ const FastModifyPrice: React.FC<{}> = () => {
priceType!==3 && <Form.Item priceType!==3 && <Form.Item
label="" label=""
name="ladderPrice" name="ladderPrice"
valuePropName="checked"
> >
<Checkbox checked={ladderPrice} onChange={changeLadderPrice}>阶梯价格</Checkbox> <Checkbox onChange={changeLadderPrice}>阶梯价格</Checkbox>
</Form.Item> </Form.Item>
} }
{ {
...@@ -502,7 +491,7 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -502,7 +491,7 @@ const FastModifyPrice: React.FC<{}> = () => {
} }
]} ]}
> >
<Form.List name="ladderRange" key={Math.random()}> <Form.List name="ladderRange">
{(fields, { add, remove }) => { {(fields, { add, remove }) => {
if (!fields.length) { if (!fields.length) {
add() add()
...@@ -512,84 +501,61 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -512,84 +501,61 @@ const FastModifyPrice: React.FC<{}> = () => {
{fields.map(field => ( {fields.map(field => (
<Row key={field.key} gutter={[0, 10]}> <Row key={field.key} gutter={[0, 10]}>
<Col span={20} style={{ display: 'flex' }}> <Col span={20} style={{ display: 'flex' }}>
<Item <Form.Item
{...field}
name={[field.name, 'numberRange', 'numberMin']}
fieldKey={[field.fieldKey, 'numberRange', 'numberMin']}
rules={[
{ required: true, message: '阶梯最小数量为必填项' },
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值仅限三位小数',
}
]}
>
<Input placeholder="最小数量" />
</Form.Item>
<Input
style={{
width: 30,
height: 32,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
{...field} {...field}
name={[field.name, 'numberRange']} name={[field.name, 'numberRange', 'numberMax']}
fieldKey={[field.fieldKey, 'numberRange']} fieldKey={[field.fieldKey, 'numberRange', 'numberMax']}
key={'_' + field.fieldKey} rules={[
noStyle { required: true, message: '阶梯最大数量为必填项' },
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值仅限三位小数',
}
]}
> >
<Input.Group compact> <Input placeholder="最大数量" />
<Form.Item </Form.Item>
name={[field.name, 'numberRange', 'numberMin']}
noStyle <Form.Item
rules={[
{
required: true,
message: '阶梯最小数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<Input style={{ width: 100, textAlign: 'center' }} placeholder="最小数量" />
</Form.Item>
<InputNumber
style={{
width: 30,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
name={[field.name, 'numberRange', 'numberMax']}
noStyle
rules={[
{
required: true,
message: '阶梯最大数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<InputNumber
className={styles.siteInputRight}
style={{
width: 100,
textAlign: 'center',
}}
placeholder="最大数量"
/>
</Form.Item>
</Input.Group>
</Item>
<Item
{...field} {...field}
name={[field.name, 'numberPrice']} name={[field.name, 'numberPrice']}
fieldKey={[field.fieldKey, 'numberPrice']} fieldKey={[field.fieldKey, 'numberPrice']}
key={'__' + field.fieldKey}
noStyle
rules={[ rules={[
{ { required: true, message: '阶梯单价为必填项' },
required: true,
message: '阶梯单价为必填项'
},
{ {
pattern: /^\d+(\.\d{1,4})?$/, pattern: /^\d+(\.\d{1,4})?$/,
message: '阶梯单价小数点后仅限四位', message: '阶梯单价仅限四位小数',
} }
]} ]}
style={{marginLeft: 20}}
> >
<Input style={{ width: '50%', marginLeft: 24 }} placeholder="请输入单价" /> <Input placeholder="请输入单价" />
</Item> </Form.Item>
</Col> </Col>
<Col span={4}> <Col span={4}>
<Button size="small" onClick={() => add()} style={{ marginLeft: 20, marginRight: 8 }} icon={<PlusOutlined />} /> <Button size="small" onClick={() => add()} style={{ marginLeft: 20, marginRight: 8 }} icon={<PlusOutlined />} />
......
...@@ -369,7 +369,7 @@ const AccountDetail: React.FC<{}> = () => { ...@@ -369,7 +369,7 @@ const AccountDetail: React.FC<{}> = () => {
<img src={qrCode} alt=""/> <img src={qrCode} alt=""/>
<div className={styles.scanTips}> <div className={styles.scanTips}>
<ScanOutlined className={styles.scanIcon} /> <ScanOutlined className={styles.scanIcon} />
<span>打开 {rechargeType === 1 ? '微信' : '支付宝'}App<br />扫码完成充值</span> <span>打开 {rechargeType === 2 ? '微信' : '支付宝'}App<br />扫码完成充值</span>
</div> </div>
</div> </div>
</Modal> </Modal>
......
...@@ -140,7 +140,7 @@ export const rechargeSchema: ISchema = { ...@@ -140,7 +140,7 @@ export const rechargeSchema: ISchema = {
"x-component-props": { "x-component-props": {
dataSource: [ dataSource: [
// {id: 1, name: '支付宝', logoUrl: alipay}, // {id: 1, name: '支付宝', logoUrl: alipay},
{id: 1, name: '微信', logoUrl: wxpay} {id: 2, name: '微信', logoUrl: wxpay}
], ],
type: 'radio' // CardCheckBox 单选模式 type: 'radio' // CardCheckBox 单选模式
}, },
......
...@@ -245,12 +245,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -245,12 +245,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const fetchMemberList = async (params) => { const fetchMemberList = async (params) => {
const shopType = addSchemaAction.getFieldValue('shopType'); const shopType = addSchemaAction.getFieldValue('shopType');
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数 // 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数
const { channelMemberIdList, channelMemberRoleIdList } = productState; const { members } = productState;
const data = { const data = {
...params, ...params,
shopType: shopType, shopType: shopType,
memberIds: channelMemberIdList, members: members
roleIds: channelMemberRoleIdList
} }
const res = await PublicApi.postMemberManageAllPageByshoptype(data, {ctlType: 'none'}); const res = await PublicApi.postMemberManageAllPageByshoptype(data, {ctlType: 'none'});
return res.data return res.data
...@@ -422,7 +421,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -422,7 +421,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
}, },
}, },
properties: { properties: {
categoryId: { customerCategoryId: {
type: 'string', type: 'string',
"x-component": 'SearchSelect', "x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
......
...@@ -63,12 +63,12 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe ...@@ -63,12 +63,12 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
<List <List
itemLayout="horizontal" itemLayout="horizontal"
dataSource={transData || []} dataSource={transData || []}
renderItem={(item: string) => ( renderItem={(item: string, index: number) => (
<List.Item style={{fontSize: 12}} extra={<Button type='link' onClick={imgRef.current.toggle}>预览</Button>}> <List.Item style={{fontSize: 12}} extra={<Button type='link' onClick={() => imgRef.current.toggle(index)}>预览</Button>}>
<OverflowText style={{flex: '.9'}}> <OverflowText style={{flex: '.9'}}>
{item} {item}
</OverflowText> </OverflowText>
<ImagePreview src={item} currentRef={imgRef}/> <ImagePreview src={transData || []} currentRef={imgRef}/>
</List.Item> </List.Item>
)} )}
/> />
......
import { productColumns } from './../../../../afterService/exchangeGoods/waitAddLogisticsOrder/opration/component/selectProductModal.tsx/index';
import { ISchemaFormActions, FormEffectHooks, IFieldState, ISchemaFormAsyncActions, createEffectHook } from '@formily/antd'; import { ISchemaFormActions, FormEffectHooks, IFieldState, ISchemaFormAsyncActions, createEffectHook } from '@formily/antd';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'; import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { useLinkageUtils } from '@/utils/formEffectUtils'; import { useLinkageUtils } from '@/utils/formEffectUtils';
...@@ -87,6 +88,7 @@ export const useEditHideField = () => { ...@@ -87,6 +88,7 @@ export const useEditHideField = () => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => { export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => { FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
const { value } = state const { value } = state
console.log(value, 'vlaue')
const payInfoData = ctx.getFieldValue('paymentInformationResponses') const payInfoData = ctx.getFieldValue('paymentInformationResponses')
// 强制渲染一次, 用于触发金额总数 // 强制渲染一次, 用于触发金额总数
update() update()
...@@ -97,7 +99,8 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor ...@@ -97,7 +99,8 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 请求一次并复制给支付信息 // 请求一次并复制给支付信息
const productItem = value[0] const productItem = value[0]
fetchOrderApi.getPayInfoList({ fetchOrderApi.getPayInfoList({
productId: productItem.id, // productId: productItem.id,
productId: productItem?.commodityId ? productItem.id : productItem.productId,
memberId: productItem.memberId memberId: productItem.memberId
}).then(data => { }).then(data => {
ctx.setFieldValue('paymentInformationResponses', data) ctx.setFieldValue('paymentInformationResponses', data)
......
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