Commit a776fdb9 authored by GuanHua's avatar GuanHua
parents 844a295a 90041bc7
......@@ -26,7 +26,7 @@ const SelectContent = (props) => {
// 自定义搜索型下拉框
const SearchSelect = (props: ISchemaFieldComponentProps) => {
const ref = useRef<any>({})
const { schema, form, path, mutators } = props
const { schema, form, path, mutators, editable } = props
const dataSourceRef = useRef<any[]>([])
const pinyinRef = useRef<any[]>([])
// 可选参数 fetchSearch, select为search
......@@ -62,6 +62,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
}
useEffect(() => {
if (!editable) {
return ;
}
setLoading(true)
fetchSearch({
[fetchParams]: ''
......@@ -128,6 +131,7 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption={false}
loading={loading}
options={dataSource}
disabled={!editable}
// getPopupContainer={triggerNode => {
// return triggerNode
// }}
......
......@@ -22,7 +22,7 @@ import CustomRadio from './components/CustomRadio';
import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import './index.less'
import { Checkbox } from '@formily/antd-components';
import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import VirtualChildren from './components/VirtualChildren'
import { useLinkComponentProps } from './linkages/linkComponentProps';
......@@ -92,7 +92,8 @@ export const componentExport = {
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect,
VirtualChildren
VirtualChildren,
RadioGroup: Radio.Group
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, ...reset } = props;
......
......@@ -131,11 +131,18 @@ const ViewDriectChannel: React.FC<{}> = () => {
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="商品信息">
<p>
<Avatar size={48} shape="square" src={channelDetails?.unitPriceAndPicList[0]?.commodityPic && channelDetails.unitPriceAndPicList[0].commodityPic[0]} />
<Avatar size={48} shape="square" src={channelDetails?.channelCommodity?.commodity?.mainPic} />
<span style={{color:'rgba(23,43,77,1)',fontSize:20,fontWeight:500,marginLeft:16}}>{channelDetails?.name}</span>
<span style={{color:'#E63F3B',padding:'2px 5px',background:'rgba(255,235,230,1)',borderRadius:'4px',marginLeft:16,marginRight:16}}>{channelDetails?.channelCommodity?.source === 1 ? "上级渠道" : "渠道自有"}</span>
<a>去查看 &gt;</a>
{/* <a href={channelDetails?.source === 1 ? `/shop/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}` : `/memberCenter/commodityAbility/commodity/products/viewProducts?id=${channelDetails?.channelCommodity?.commodity?.id}`}>去查看 &gt;</a> */}
{/* <a>去查看 &gt;</a> */}
<a
href={
channelDetails?.channelCommodity?.source === 1 ?
`/channelmall/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}&channelId=${btoa(JSON.stringify({ shopId: '', memberId: channelDetails?.channelCommodity?.parentMemberId }))}` :
`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${channelDetails?.channelCommodity?.commodity?.id}`
}
// target="blank"
>去查看 &gt;</a>
</p>
{content}
</Card>
......
......@@ -25,14 +25,12 @@ const AddRule:React.FC<{}> = (props) => {
// 整体表单提交
const formSubmit = async (values) => {
const params = omit(values, ['NO_SUBMIT3'])
if (params['applyMember']) {
params['applyMember'] = params['applyMember'].map(v => v.memberId)
}
await PublicApi.postWarehouseFreightSpaceAdd(params)
setTimeout(() => {
history.goBack(-1)
}, 1000)
// const params = omit(values, ['NO_SUBMIT3'])
console.log(values, 'values')
// await PublicApi.postOrderTradingRulesAdd(params)
// setTimeout(() => {
// history.goBack(-1)
// }, 1000)
}
return (
......
......@@ -39,8 +39,8 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
pageStatus
} = usePageStatus()
const initValue = useInitValue(PublicApi.getWarehouseFreightSpaceDetails)
useUnitPreview(initValue, addSchemaAction)
const initValue = useInitValue(PublicApi.getOrderTradingRulesDetails)
// useUnitPreview(initValue, addSchemaAction)
const fetchProductList = async (params) => {
const tradingRulesId = addSchemaAction.getFieldValue('transactionProcesssId')
......@@ -54,7 +54,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// table删除商品
const handleDeleteTable = (id) => {
const value = addSchemaAction.getFieldValue('products')
console.log(value, 'v', findItemAndDelete(value, id))
addSchemaAction.setFieldValue('products', findItemAndDelete(value, id, 'productId'))
}
......@@ -230,7 +229,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
createAddContractTemplateEffect(addSchemaAction)
$('onFieldValueChange', 'isElectronicContract').subscribe(parentState => {
setFieldState('contractTemplateId', state => {
setFieldState('electronicContractId', state => {
state.visible = parentState.value
})
})
......
......@@ -7,7 +7,7 @@ const { onFieldValueChange$ } = FormEffectHooks
export const createAddContractTemplateEffect = (context: ISchemaFormActions) => {
const fetchListContractTemplateAll = async () => {
const { data } = await PublicApi.getOrderSelectListContractTemplate()
context.setFieldState('contractTemplateId', state => {
context.setFieldState('electronicContractId', state => {
state.contractTemplateLists = data
})
return data.map(v => ({
......@@ -16,7 +16,7 @@ export const createAddContractTemplateEffect = (context: ISchemaFormActions) =>
}))
}
useAsyncSelect('contractTemplateId', fetchListContractTemplateAll)
useAsyncSelect('electronicContractId', fetchListContractTemplateAll)
}
export const useUnitPreview = (initValue, context) => {
......
......@@ -76,7 +76,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"x-component": "checkboxsingle",
default: false
},
contractTemplateId: {
electronicContractId: {
type: 'string',
required: true,
enum: [],
......
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