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

fix:新建交易规则选所有商品提交异常

parent 7a88dc8b
......@@ -3,7 +3,8 @@ import { history } from 'umi';
import { Button, Card, Tabs, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
SaveOutlined, EditFilled,
SaveOutlined,
EditFilled,
} from '@ant-design/icons'
import ReutrnEle from '@/components/ReturnEle'
......@@ -20,9 +21,6 @@ import ProductDescFormCloud from './addProductsItem/productDescFormCloud'
import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import { PublicApi } from '@/services/api'
import { render } from '@/app';
const demoFetch = require('../../../../demo').fetchConfig
const { TabPane } = Tabs
......@@ -78,7 +76,6 @@ const AddProducts: React.FC<{}> = (props) => {
// 获取页面使用模板
const productDescriptionTemplate = async () => {
let globalData = await demoFetch()
//@ts-ignore
PublicApi.getTemplateGoodsFindUseGoodsTemplate({ siteId }).then(res => {
if (res.code === 1000)
......
......@@ -37,19 +37,12 @@ const layoutFormList = {
push: 2
},
}
const tailLayout = {
wrapperCol: {
offset: 2,
span: 12,
},
}
interface Iprops {
onChangeAttributeList: (attributeLists:any)=> void;
onRef: (refs: any) => void;
}
interface AreaParams {
provinceCode: any;
provinceName: any;
......@@ -382,14 +375,6 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
>
{showCategory && <><span className="commonStatusValid"></span>{renderCategoryType()}</>}
</Form.Item>
{/* <Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存
</Button>
<Button className={styles.ml20}>
取消
</Button>
</Form.Item> */}
</Form>
</>)
}
......
import React, { useState, useEffect, useRef } from 'react'
import { history } from 'umi'
import { Form, Select, Radio, Input, Checkbox, InputNumber } from 'antd'
import { Form, Select, Radio, Checkbox, InputNumber } from 'antd'
import { PublicApi } from '@/services/api'
import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListShipperAddressResponse, GetLogisticsSelectListFreightTemplateResponse } from '@/services'
import { store } from '@/store'
......
import React, { useState, useEffect, useRef } from 'react'
import React, { useEffect, useRef } from 'react'
import { history } from 'umi'
import { Form, Select, Radio, Input } from 'antd'
import { Form, Radio, Input } from 'antd'
import { store } from '@/store'
import { validatorByte } from '@/utils/regExp'
const { ProductStore } = store
......@@ -18,7 +18,6 @@ export interface Iprops {
onRef: (refs: any) => void;
}
const { Option } = Select
const { TextArea } = Input
const OtherForm: React.FC<Iprops> = (props) => {
......
import React, { useState, useEffect, useRef, useContext, useCallback, useMemo } from 'react'
import React, { useState, useEffect, useRef, useMemo } from 'react'
import {history} from 'umi'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber, message } from 'antd'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber } from 'antd'
import styles from './index.less'
import { PublicApi } from '@/services/api'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { EyeOutlined, QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, } from '@ant-design/icons'
import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, } from '@ant-design/icons'
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
import { IProductSelectAttribute } from '@/module/productModule'
import moment from 'moment'
import { observable } from 'mobx'
const _ = require("lodash");
......@@ -49,7 +46,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const [setPriceModal, setSetPriceModal] = useState(false)
const [ladderPrice, setLadderPrice] = useState(false)
const [curretSetPriceRow, setCurrentSetPriceRow] = useState<any>()
// const [stateTableData, setStateTableData] = useState<any[]>()
const [combineAttributeArray, setCombineAttributeArray] = useState<any[]>([])
const [attributeObjArr, setAttributeObjArr] = useState<any[]>([])
const [attributeValObjArr, setAttributeValObjArr] = useState<any[]>([])
......@@ -422,7 +418,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setPriceForm.resetFields()
setLadderPrice(false)
setPlanPrice(v.target.value)
// priceTypeRef.current = v.target.value
}
const setPriceOk = () => {
......
import React, { useState, useEffect, useRef, useContext } from 'react'
import React, { useState, useEffect, useRef } from 'react'
import {history} from 'umi'
import { Button, Form, Select, Checkbox, Tabs, Input, DatePicker } from 'antd'
import styles from './index.less'
import { Form, Select, Checkbox, Tabs, Input, DatePicker } from 'antd'
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
......@@ -270,14 +269,6 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
)
}
</Tabs>
{/* <Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存
</Button>
<Button className={styles.ml20}>
取消
</Button>
</Form.Item> */}
</Form>
{attributesData?.length === 0 && <span style={{opacity: 0.6}}>暂无数据!</span>}
</>)
......
import React, { useState, useEffect, useRef } from 'react'
import {history} from 'umi'
import { Button, Form, Select, Checkbox, message, Input, Table, Modal, Row, Col, Alert, Upload, Radio } from 'antd'
import { message, Modal, Row, Col, Alert, Upload, Radio } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
import CustomTabs, { ItemPane } from '@/components/CustomTabs'
import styles from './index.less'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import { UploadFile } from 'antd/lib/upload/interface';
import { UPLOAD_TYPE } from '@/constants'
import { inject, observer } from 'mobx-react'
......@@ -36,12 +35,8 @@ const ProductImageForm: React.FC<{}> = (props) => {
// 编辑下 flag为false 不清空;编辑下 flag为true 新建清空
if(history.location.query?.id && !flagRef.current) {
flagRef.current = true
console.log('不清空')
} else {
// constructImageListByRender([])
// setSetImageType(true)
onChangeSetImageType({target: { value: true }})
console.log('清空')
}
}, [selectCategoryId])
......
import React, { useState, useEffect, useContext, useRef } from 'react'
import React, { useState, useEffect, useRef } from 'react'
import {history} from 'umi'
import { Button, Form, Select, Checkbox } from 'antd'
import styles from './index.less'
import { Form, Checkbox } from 'antd'
// import styles from './index.less'
import { PublicApi } from '@/services/api'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
......@@ -20,11 +20,7 @@ const layout = {
},
}
export interface Iprops {
}
const SelectGoodsForm: React.FC<Iprops> = (props) => {
const SelectGoodsForm: React.FC<{}> = (props) => {
const ref = useRef<any>({})
const [selectGoodsForm] = Form.useForm()
const [isSelectGoods, setIsSelectGoods] = useState<boolean>(true) // 货品table显示隐藏
......
......@@ -28,14 +28,15 @@ const AddRule:React.FC<{}> = (props) => {
// 整体表单提交
const formSubmit = async (values) => {
setIsDisabled(true)
values.products = values.products.map(item => ({
productId: item.id,
commodityId: item.commodityId,
name: item.name,
customerCategoryName: item.customerCategoryName,
priceType: item.priceType,
brandName: item.brandName
}))
if(values?.products)
values.products = values.products.map(item => ({
productId: item.id,
commodityId: item.commodityId,
name: item.name,
customerCategoryName: item.customerCategoryName,
priceType: item.priceType,
brandName: item.brandName
}))
values.isElectronicContract = values.isElectronicContract ? 1 : 0
const params = omit(values, ['state']) // 移除不需要的字段
......
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