Commit eae42aa1 authored by XieZhiXiong's avatar XieZhiXiong
parents 851998ab 38aa787a
/* /*
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50 * @Date: 2020-07-13 14:08:50
* @LastEditors: XieZhiXiong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-03 09:56:52 * @LastEditTime: 2020-09-04 17:28:55
*/ */
export default { export default {
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
'menu.tranactionAbility.enquirySubmit': '需求发布', 'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单', 'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单',
'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单', 'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单',
'menu.tranactionAbility.enquirySubmit.viewEnquiryDetail': '需求单详情',
'menu.tranactionAbility.enquirySubmit.enquiryOne': '待审核报价单(一级)', 'menu.tranactionAbility.enquirySubmit.enquiryOne': '待审核报价单(一级)',
'menu.tranactionAbility.enquirySubmit.enquiryTwo': '待审核报价单(二级)', 'menu.tranactionAbility.enquirySubmit.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.purchaseOrder': '采购订单', 'menu.tranactionAbility.purchaseOrder': '采购订单',
......
import { GetProductChannelCommodityGetCommodityListResponseDetail } from '@/services'; import { GetProductChannelCommodityGetCommodityListResponseDetail, GetProductChannelCommodityGetCommodityUnitPriceResponse } from '@/services';
export interface IChannelProductModule { export interface IChannelProductModule {
productSelectRowInStore: GetProductChannelCommodityGetCommodityListResponseDetail; productSelectRowInStore: GetProductChannelCommodityGetCommodityListResponseDetail;
priceType: number; priceType: number;
productName: string; productName: string;
currentActiveKey: number; currentActiveKey: string;
currentOperateChannel: string; currentOperateChannel: string;
tableDataInSetPrice: GetProductChannelCommodityGetCommodityUnitPriceResponse[];
setProductSelectRowInStore(data: GetProductChannelCommodityGetCommodityListResponseDetail): void; setProductSelectRowInStore(data: GetProductChannelCommodityGetCommodityListResponseDetail): void;
setPriceType(data: number): void; setPriceType(data: number): void;
setProductName(data: string): void; setProductName(data: string): void;
setCurrentActiveKey(data: string): void; setCurrentActiveKey(data: string): void;
setCurrentOperateChannel(data: string): void; setCurrentOperateChannel(data: string): void;
setTableDataInSetPrice(data: GetProductChannelCommodityGetCommodityUnitPriceResponse[]): void;
} }
\ No newline at end of file
...@@ -74,6 +74,7 @@ const AddPropertyValue: React.FC<{}> = () => { ...@@ -74,6 +74,7 @@ const AddPropertyValue: React.FC<{}> = () => {
const handleSubmitAllSetting = () => { const handleSubmitAllSetting = () => {
attrValueForm.validateFields().then(values => { attrValueForm.validateFields().then(values => {
const { attrId, attrName } = history.location.query
let pararms = {...values} let pararms = {...values}
delete pararms.attributeName delete pararms.attributeName
if(JSON.stringify(pararms.attributeValue)==='{}') if(JSON.stringify(pararms.attributeValue)==='{}')
...@@ -82,7 +83,7 @@ const AddPropertyValue: React.FC<{}> = () => { ...@@ -82,7 +83,7 @@ const AddPropertyValue: React.FC<{}> = () => {
PublicApi.postProductCustomerSaveOrUpdateCustomerAttributeValue(pararms).then(res => { PublicApi.postProductCustomerSaveOrUpdateCustomerAttributeValue(pararms).then(res => {
if(res.code === 1000) if(res.code === 1000)
// history.goBack() // history.goBack()
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue?before=${history.location.query.attrId}`) history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue?attrId=${attrId}&attrName=${attrName}`)
}) })
}).catch(error => { }).catch(error => {
......
...@@ -51,8 +51,8 @@ const PropertyValue: React.FC<{}> = () => { ...@@ -51,8 +51,8 @@ const PropertyValue: React.FC<{}> = () => {
useEffect(() => { useEffect(() => {
let prefix = sessionStorage.getItem('beforeKeyPrefix') let prefix = sessionStorage.getItem('beforeKeyPrefix')
let beforeKey = history.location.query.before let beforeKey = history.location.query.attrId
console.log(prefix, beforeKey)
if(beforeKey){ // 展开之前的选择项 if(beforeKey){ // 展开之前的选择项
setSelectKey(beforeKey) setSelectKey(beforeKey)
treeActions.setExpandedKeys([`${prefix}_${beforeKey}`]) // 拼接不正常的key treeActions.setExpandedKeys([`${prefix}_${beforeKey}`]) // 拼接不正常的key
...@@ -240,7 +240,9 @@ const PropertyValue: React.FC<{}> = () => { ...@@ -240,7 +240,9 @@ const PropertyValue: React.FC<{}> = () => {
<Button <Button
type="primary" type="primary"
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={() => { history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey}&attrName=${selectNode._title}`) }} onClick={() => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}`)
}}
> >
新建 新建
</Button> </Button>
......
import React, {useState, useRef, useEffect} from 'react' import React, {useState, useRef, useEffect} from 'react'
import { history } from 'umi'; import { history } from 'umi';
import { Button, Form, Card, Tabs, Input, Radio, Table, message, Row, Col } from 'antd' import { Button, Form, Card, Tabs, Input, Radio, Table, message, Row, Col, Select } from 'antd'
import { import {
PlusOutlined, SettingOutlined, PlusOutlined, SettingOutlined,
} from '@ant-design/icons' } from '@ant-design/icons'
...@@ -14,6 +14,7 @@ import { store } from '@/store' ...@@ -14,6 +14,7 @@ import { store } from '@/store'
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
const { Search } = Input const { Search } = Input
const { Option } = Select
const layout = { const layout = {
labelCol: { labelCol: {
...@@ -24,6 +25,12 @@ const layout = { ...@@ -24,6 +25,12 @@ const layout = {
}, },
} }
interface IOption {
key: string;
value: number;
children: string;
}
interface IProps { interface IProps {
onRef: (refs: any) => void; onRef: (refs: any) => void;
} }
...@@ -37,6 +44,7 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -37,6 +44,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
const [memberRoleList, setMemberRoleList] = useState<any[]>([]) const [memberRoleList, setMemberRoleList] = useState<any[]>([])
const [selectedMemberRowKeys, setSelectedMemberRowKeys] = useState<any>([]) const [selectedMemberRowKeys, setSelectedMemberRowKeys] = useState<any>([])
const [selectMemberRow, setSelectMemberRow] = useState<any[]>([]) // 选中的会员弹框数据 const [selectMemberRow, setSelectMemberRow] = useState<any[]>([]) // 选中的会员弹框数据
const [selectedOption ,setSelectedOption] = useState<IOption>()
const { ChannelProudctStore } = store const { ChannelProudctStore } = store
const { const {
...@@ -117,12 +125,25 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -117,12 +125,25 @@ const SelectChannel:React.FC<IProps> = (props) => {
useEffect(() => { useEffect(() => {
onRef(formMember) onRef(formMember)
// 获取所有的会员角色
PublicApi.getMemberManageRoleList().then(res => {
const { data } = res
setMemberRoleList(data)
if(data.length > 0){
let initSelectOption = {
key: '0',
value: data[0].roleId,
children: data[0].roleName
}
setSelectedOption(initSelectOption)
}
})
}, []) }, [])
// 获取渠道会员 // 获取渠道会员
const fetchMemberData = (params: any) => { const fetchMemberData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getMemberManageChannelLowerPage(params).then(res => { PublicApi.getMemberManageChannelLowerPage({ memberIds: [], name: selectedOption.children, roleId: selectedOption.value ,...params }).then(res => {
const { data } = res const { data } = res
resolve(data) resolve(data)
}) })
...@@ -170,68 +191,79 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -170,68 +191,79 @@ const SelectChannel:React.FC<IProps> = (props) => {
setCurrentOperateChannel('所有渠道会员') setCurrentOperateChannel('所有渠道会员')
} }
const roleChange = (value: number, option: IOption) => {
setSelectedOption(option)
}
return (<> return (<>
<Row> <Row>
<Col span={18}> {
<Form memberRoleList.length>0 && <>
{...layout} <Col span={18}>
form={formMember} <Form
name="add-channel-merchant" {...layout}
labelAlign="left" form={formMember}
> name="add-channel-merchant"
{/* { labelAlign="left"
memberRoleList.length>0 && <Form.Item name="channelMemberRoleId"> colon={false}
<Radio.Group buttonStyle="solid" className={styles.customizeRadio}> initialValues={{channelMemberRoleId: memberRoleList[0].roleId}}
{
memberRoleList.map((item, index) => (
<Radio.Button key={index} value={item.roleId}>{item.roleName}</Radio.Button>
))
}
</Radio.Group>
</Form.Item>
} */}
<Form.Item name="channelMemberRoleId">
<Radio.Group buttonStyle="solid" defaultValue={1} className={styles.customizeRadio}>
<Radio.Button key={1} value={1}>渠道采购商</Radio.Button>
<Radio.Button key={2} value={2}>渠道自有采购商</Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item
name="isAllMember"
label="选择渠道会员"
rules={[{
required: true,
message: '请选择渠道会员'
}]}
initialValue={isAllMember}
> >
<Radio.Group onChange={handleIsAllMemberChange}> {/* <Form.Item name="channelMemberRoleId">
<Radio value={true}>所有渠道会员(默认)</Radio> <Radio.Group buttonStyle="solid" defaultValue={1} className={styles.customizeRadio}>
<Radio value={false}>指定渠道会员</Radio> <Radio.Button key={1} value={1}>渠道采购商</Radio.Button>
</Radio.Group> <Radio.Button key={2} value={2}>渠道自有采购商</Radio.Button>
</Form.Item> </Radio.Group>
</Form> </Form.Item> */}
</Col> <Form.Item
<Col span={6} style={{display: 'flex', justifyContent: 'flex-end', flexWrap: 'wrap'}}> label="选择渠道角色"
<div> name="channelMemberRoleId"
<p> >
<Search <Select onChange={roleChange} placeholder="选择渠道会员角色">
placeholder="渠道会员名称" {
onSearch={value => console.log(value)} memberRoleList.map((item, index) => (
style={{ width: 256 }} <Option key={index} value={item.roleId}>{item.roleName}</Option>
/> ))
</p> }
</div> </Select>
<div> </Form.Item>
<p> <Form.Item
<Button name="isAllMember"
type="text" label="选择渠道会员"
icon={<SettingOutlined />} rules={[{
onClick={clickBatchSetting} required: true,
>批量设置渠道商品</Button> message: '请选择渠道会员'
</p> }]}
</div> initialValue={isAllMember}
</Col> >
<Radio.Group onChange={handleIsAllMemberChange}>
<Radio value={true}>所有渠道会员(默认)</Radio>
<Radio value={false}>指定渠道会员</Radio>
</Radio.Group>
</Form.Item>
</Form>
</Col>
<Col span={6} style={{display: 'flex', justifyContent: 'flex-end', flexWrap: 'wrap'}}>
<div>
<p>
<Search
placeholder="渠道会员名称"
onSearch={value => console.log(value)}
style={{ width: 256 }}
/>
</p>
</div>
<div>
<p>
<Button
type="text"
icon={<SettingOutlined />}
onClick={clickBatchSetting}
>批量设置渠道商品</Button>
</p>
</div>
</Col>
</>
}
</Row> </Row>
{ {
!isAllMember ? <> !isAllMember ? <>
......
...@@ -116,7 +116,7 @@ const SelectProduct:React.FC<IProps> = (props) => { ...@@ -116,7 +116,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
] ]
useEffect(() => { useEffect(() => {
onRef(productFormRef) onRef(formProduct)
formProduct.setFieldsValue({source: source}) formProduct.setFieldsValue({source: source})
// 获取会员角色列表 // 获取会员角色列表
......
...@@ -69,11 +69,12 @@ const SetPrice:React.FC<IProps> = (props) => { ...@@ -69,11 +69,12 @@ const SetPrice:React.FC<IProps> = (props) => {
priceType, priceType,
productName, productName,
productSelectRowInStore, productSelectRowInStore,
currentOperateChannel currentOperateChannel,
setTableDataInSetPrice
} = ChannelProudctStore } = ChannelProudctStore
useEffect(() => { useEffect(() => {
onRef(formPrice)
}, []) }, [])
...@@ -93,6 +94,7 @@ const SetPrice:React.FC<IProps> = (props) => { ...@@ -93,6 +94,7 @@ const SetPrice:React.FC<IProps> = (props) => {
} }
const structureTable = (data: any, name?: string) => { const structureTable = (data: any, name?: string) => {
console.log(data, 'structureTableData')
// 构建table 列columns // 构建table 列columns
let col: any = [] let col: any = []
let temp: any = [] let temp: any = []
...@@ -148,11 +150,11 @@ const SetPrice:React.FC<IProps> = (props) => { ...@@ -148,11 +150,11 @@ const SetPrice:React.FC<IProps> = (props) => {
}) })
_tableData.push({ _tableData.push({
"id": item.id, // 行数据id "id": item.id, // 行数据id
"goodsId": item.goods.id, // 货品ID "goodsId": item.goods?.id || '', // 货品ID 可能为null
"索引": index, "索引": index,
// "商品名称": productRowCtl.selectRow[0].name, // "商品名称": productRowCtl.selectRow[0].name,
"商品名称": name || productName, "商品名称": name || productName,
"对应货品": item.goods.name, "对应货品": item.goods?.name || '',
...temp, ...temp,
"单价": item.unitPrice "单价": item.unitPrice
}) })
...@@ -322,6 +324,7 @@ const SetPrice:React.FC<IProps> = (props) => { ...@@ -322,6 +324,7 @@ const SetPrice:React.FC<IProps> = (props) => {
newTabeData[curretSetPriceRow['索引']] = _row newTabeData[curretSetPriceRow['索引']] = _row
} }
setPriceTableData(newTabeData) setPriceTableData(newTabeData)
console.log(newTabeData, '价格修改之后的tableData')
}) })
} }
...@@ -398,9 +401,9 @@ const SetPrice:React.FC<IProps> = (props) => { ...@@ -398,9 +401,9 @@ const SetPrice:React.FC<IProps> = (props) => {
</Button> </Button>
{ {
priceTableData.length > 0 && priceType != 2 && priceTableData.length > 0 && priceType != 2 &&
<Button <Button
type="text" type="text"
style={{float: 'right'}} style={{float: 'right'}}
onClick={clickBatchSetPrice} onClick={clickBatchSetPrice}
> >
<SettingOutlined /> <SettingOutlined />
......
...@@ -35,7 +35,10 @@ const AddDirectChannel:React.FC<{}> = (props) => { ...@@ -35,7 +35,10 @@ const AddDirectChannel:React.FC<{}> = (props) => {
} = ChannelProudctStore } = ChannelProudctStore
useEffect(() => { useEffect(() => {
console.log('初始化')
return () => {
setCurrentActiveKey('1')
}
}, []) }, [])
...@@ -47,6 +50,7 @@ const AddDirectChannel:React.FC<{}> = (props) => { ...@@ -47,6 +50,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
const onSave = () => { const onSave = () => {
let data = formRefs.map(async __ => { let data = formRefs.map(async __ => {
console.log(__, '____')
return ( return (
await __.validateFields() await __.validateFields()
) )
......
...@@ -14,11 +14,15 @@ import PriceAttributeForm from './addProductsItem/priceAttributeForm' ...@@ -14,11 +14,15 @@ import PriceAttributeForm from './addProductsItem/priceAttributeForm'
import LogisticsForm from './addProductsItem/logisticsForm' import LogisticsForm from './addProductsItem/logisticsForm'
import OtherForm from './addProductsItem/otherForm' import OtherForm from './addProductsItem/otherForm'
import ProductImageForm from './addProductsItem/productImageForm' import ProductImageForm from './addProductsItem/productImageForm'
import ProductDescFormOne from './addProductsItem/productDescFormOne' import ProductDescFormDefualt from './addProductsItem/productDescFormDefault'
import ProductDescFormCloud from './addProductsItem/productDescFormCloud'
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
import { store } from '@/store' import { store } from '@/store'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { render } from '@/app';
const demoFetch = require('../../../../demo').fetchConfig
const { TabPane } = Tabs const { TabPane } = Tabs
...@@ -28,6 +32,7 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -28,6 +32,7 @@ const AddProducts: React.FC<{}> = (props) => {
const [attributeList, setAttributeList] = useState<any[]>([]) const [attributeList, setAttributeList] = useState<any[]>([])
const [clickTabIndex, setClickTabIndex] = useState<string[]>(['1']) const [clickTabIndex, setClickTabIndex] = useState<string[]>(['1'])
const [isDisableSaveBtn, setIsDisableSaveBtn] = useState<boolean>(false) const [isDisableSaveBtn, setIsDisableSaveBtn] = useState<boolean>(false)
const [currentTemplateName, setCurrentTemplateName] = useState<string>()
let [formRefs, setFormRefs] = useState([]) //子form的ref数组 let [formRefs, setFormRefs] = useState([]) //子form的ref数组
const { ProductStore } = store const { ProductStore } = store
const { const {
...@@ -45,6 +50,8 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -45,6 +50,8 @@ const AddProducts: React.FC<{}> = (props) => {
} = ProductStore } = ProductStore
useEffect(()=>{ useEffect(()=>{
productDescriptionTemplate()
const { id } = history.location.query const { id } = history.location.query
if(id){ if(id){
const makeRequest = async () => { const makeRequest = async () => {
...@@ -60,10 +67,30 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -60,10 +67,30 @@ const AddProducts: React.FC<{}> = (props) => {
return () => { return () => {
clearData([]) clearData([])
console.log('添加商品组件卸载')
} }
}, []) }, [])
// useEffect(() => {
// renderTemplate(currentTemplateName)
// }, [currentTemplateName])
// 获取页面使用模板
const productDescriptionTemplate = async () => {
let globalData = await demoFetch()
PublicApi.getTemplateGoodsFindUseGoodsTemplate({siteId: globalData.global.siteId}).then(res => {
if(res.code === 1000)
setCurrentTemplateName(res.data.fileName)
})
}
// 切换模板
const renderTemplate = () => {
// if(currentTemplateName === 'science')
return <ProductDescFormDefualt />
// else if(currentTemplateName === 'cloud')
// return <ProductDescFormCloud />
}
const onSave = () => { const onSave = () => {
setIsDisableSaveBtn(true) setIsDisableSaveBtn(true)
const { id } = history.location.query const { id } = history.location.query
...@@ -296,7 +323,10 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -296,7 +323,10 @@ const AddProducts: React.FC<{}> = (props) => {
<ProductImageForm /> <ProductImageForm />
</TabPane> </TabPane>
<TabPane tab="商品描述" key="6"> <TabPane tab="商品描述" key="6">
<ProductDescFormOne /> {/* <ProductDescFormDefualt /> */}
{
renderTemplate()
}
</TabPane> </TabPane>
<TabPane tab="物流信息" key="7"> <TabPane tab="物流信息" key="7">
<LogisticsForm <LogisticsForm
......
...@@ -46,4 +46,61 @@ ...@@ -46,4 +46,61 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
} }
}
// productDescFormCloud // yunxiancai template
.cloud-container{
width: 790px;
}
.cloud-media-content-box{
width: 790px;
margin: 24px 0;
height: auto !important;
}
.cloud-descript-box{
position: relative;
width: 790px;
margin: 24px 0;
border:1px solid rgba(235,236,240,1);
text-align: center;
color:rgba(151,160,175,1);
// height: 148px;
height: 48px;
p{
height: 128px;
line-height: 128px;
}
.cloudPVideo, .cloudMiddleAddBtn{
// height: 44px;
// line-height: 1.5;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
}
.cloudDivVideo, .cloudDivImage{
margin: 24px auto;
height: auto;
img{
width: 320px;
height: 240px;
}
}
.cloud-right-btn{
position: absolute;
top: 0;
right: 0;
Button{
display: block;
width:36px;
height:36px;
background:rgba(250,251,252,1);
border-color: #ebecf0;
border-radius: 0px;
border-top: none;
border-right: none;
}
}
} }
\ No newline at end of file
...@@ -72,6 +72,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -72,6 +72,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if(history.location.query?.id){ // 编辑情况下 用于判断价格类型和显示单位 if(history.location.query?.id){ // 编辑情况下 用于判断价格类型和显示单位
setPlanPrice(productInfoByEdit?.priceType) setPlanPrice(productInfoByEdit?.priceType)
handleUnitSearch(getPriceAttributeFormParamsByEdit.unitName) handleUnitSearch(getPriceAttributeFormParamsByEdit.unitName)
setMinOrderNumber(productInfoByEdit?.minOrder) // 先设置最小起订数 便于后续价格校验
} }
return ()=>{ return ()=>{
console.log('价格属性组件卸载') console.log('价格属性组件卸载')
......
...@@ -15,7 +15,7 @@ export interface Iprops { ...@@ -15,7 +15,7 @@ export interface Iprops {
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
import { store } from '@/store' import { store } from '@/store'
const ProductDescFormOne: React.FC<Iprops> = (props) => { const ProductDescFormDefualt: React.FC<Iprops> = (props) => {
const [fileImageList, setFileImageList] = useState<any>([]) const [fileImageList, setFileImageList] = useState<any>([])
const [videoList, setVideoList] = useState<any>([]) const [videoList, setVideoList] = useState<any>([])
...@@ -180,4 +180,4 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => { ...@@ -180,4 +180,4 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => {
</>) </>)
} }
export default observer(ProductDescFormOne) export default observer(ProductDescFormDefualt)
\ No newline at end of file \ No newline at end of file
...@@ -145,11 +145,13 @@ ...@@ -145,11 +145,13 @@
padding: 12px 0; padding: 12px 0;
border:1px solid rgba(235,236,240,1); border:1px solid rgba(235,236,240,1);
display: flex; display: flex;
flex-flow: wrap;
justify-content: left; justify-content: left;
.imgItem{ .imgItem{
width:180px; width:180px;
height:180px; height:180px;
margin-left: 16px; margin-left: 16px;
margin-bottom: 12px;
border:1px solid rgba(235,236,240,1); border:1px solid rgba(235,236,240,1);
img{ img{
width: 100%; width: 100%;
...@@ -161,11 +163,18 @@ ...@@ -161,11 +163,18 @@
height:240px; height:240px;
margin-left: 16px; margin-left: 16px;
border:1px solid rgba(235,236,240,1); border:1px solid rgba(235,236,240,1);
video {
width: 100%;
height: 100%;
}
} }
p{ p{
padding: 16px; padding: 0 16px;
} }
} }
.description-word-box{
flex-direction: column;
}
.product-img-box{ .product-img-box{
margin: 24px; margin: 24px;
padding: 12px 0; padding: 12px 0;
...@@ -192,6 +201,9 @@ ...@@ -192,6 +201,9 @@
border-radius:4px; border-radius:4px;
color:rgba(0,179,122,1); color:rgba(0,179,122,1);
} }
.descript-null {
opacity: 0.6;
}
// 修改单价 // 修改单价
.site-input-right { .site-input-right {
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
UserOutlined UserOutlined
} from '@ant-design/icons' } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import cx from 'classnames'
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import styles from "./index.less" import styles from "./index.less"
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -583,10 +584,14 @@ const viewProducts: React.FC<{}> = () => { ...@@ -583,10 +584,14 @@ const viewProducts: React.FC<{}> = () => {
</Space> </Space>
<Space direction="vertical" style={{width:'100%'}}> <Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="商品描述"> <Card headStyle={{borderBottom:'none'}} title="商品描述">
{/* 预留 文字区块 */} {/* 文字区块 */}
{/* <div className={styles.descriptionBox}> <div className={cx(styles.descriptionBox, styles.descriptionWordBox)}>
<p>商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述商品描述</p> {
</div> */} productDetail?.commodityRemark?.word?.length>0 ? productDetail?.commodityRemark?.word.map((_item, _index) =>
_item && <p>{_item}</p>
) : <p className={styles.descriptNull}>暂无文字数据</p>
}
</div>
{/* 视频区块 */} {/* 视频区块 */}
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
...@@ -594,15 +599,15 @@ const viewProducts: React.FC<{}> = () => { ...@@ -594,15 +599,15 @@ const viewProducts: React.FC<{}> = () => {
<video src={_item} controls={true}> <video src={_item} controls={true}>
您的浏览器不支持视频标签,请及时升级。 您的浏览器不支持视频标签,请及时升级。
</video> </video>
</div>) : <p>暂无数据</p> </div>) : <p className={styles.descriptNull}>暂无视频数据</p>
} }
</div> </div>
{/* 图片区块 */} {/* 图片区块 */}
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
productDetail?.commodityRemark?.image?.length>0 ? productDetail?.commodityRemark?.image.map((_item, _index)=> <div key={_index} className={styles.imgItem}> productDetail?.commodityRemark?.image?.length>0 ? productDetail?.commodityRemark?.image.map((_item, _index)=> _item && <div key={_index} className={styles.imgItem}>
<img src={_item} /> <img src={_item} />
</div>) : <p>暂无数据</p> </div>) : <p className={styles.descriptNull}>暂无图片数据</p>
} }
</div> </div>
</Card> </Card>
......
...@@ -149,7 +149,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -149,7 +149,7 @@ const AddBrand: React.FC<{}> = () => {
//@ts-ignore //@ts-ignore
PublicApi.postProductBrandApplyCheckBrand({id: responseId}).then(res=>{ PublicApi.postProductBrandApplyCheckBrand({id: responseId}).then(res=>{
setCurrentStep(1) setCurrentStep(1)
setTimeout(()=>{ setTimeout(() => {
history.goBack() history.goBack()
},1000) },1000)
}) })
...@@ -263,10 +263,10 @@ const AddBrand: React.FC<{}> = () => { ...@@ -263,10 +263,10 @@ const AddBrand: React.FC<{}> = () => {
<Space direction="vertical" style={{width:'100%'}}> <Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title={tips}> <Card headStyle={{borderBottom:'none'}} title={tips}>
<Row> <Row>
<Col span={2}> {/* <Col span={2}>
<div>横版</div> <div>横版</div>
</Col> </Col> */}
<Col span={22}> <Col span={24}>
<Form.Item <Form.Item
name="proveUrl" name="proveUrl"
// valuePropName="fileList" // valuePropName="fileList"
......
...@@ -142,12 +142,14 @@ const Trademark: React.FC<{}> = () => { ...@@ -142,12 +142,14 @@ const Trademark: React.FC<{}> = () => {
const handelDelete = (record: any) => { const handelDelete = (record: any) => {
PublicApi.postProductBrandDeleteBrand({ id: record.id }).then(res => { PublicApi.postProductBrandDeleteBrand({ id: record.id }).then(res => {
if(res.code === 1000)
ref.current.reload() ref.current.reload()
}) })
} }
const handleApplyCheck = (record:any) => { const handleApplyCheck = (record:any) => {
PublicApi.postProductBrandApplyCheckBrand({id: record.id}).then(res=>{ PublicApi.postProductBrandApplyCheckBrand({id: record.id}).then(res=>{
ref.current.reload() ref.current.reload()
}) })
} }
......
...@@ -3,69 +3,10 @@ ...@@ -3,69 +3,10 @@
* @Date: 2020-08-27 16:27:53 * @Date: 2020-08-27 16:27:53
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com * @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-01 10:08:44 * @LastEditTime: 2020-09-04 17:01:46
*/ */
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
export const equiryColumns: ColumnType<any>[] = [ import moment from 'moment'
{
title: 'ID',
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '商品规格型号',
dataIndex: 'name',
key: 'name',
align: 'left'
},
{
title: '品牌',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '颜色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '尺码',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '面料',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '产地',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '单位',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
},
{
title: '采购数量',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
}
]
export const dockingColumn: ColumnType<any>[] = [ export const dockingColumn: ColumnType<any>[] = [
{ {
title: '序号', title: '序号',
...@@ -109,21 +50,188 @@ export const dockingColumn: ColumnType<any>[] = [ ...@@ -109,21 +50,188 @@ export const dockingColumn: ColumnType<any>[] = [
}, },
{ {
title: '状态', title: '需求发送状态',
dataIndex: 'state', dataIndex: 'state',
key: 'state', key: 'state',
align: 'center' align: 'center',
}, render:(text:any) => (
{ text == 0 ? '未发生需求':'已发送需求'
title: '操作', )
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
} }
] ]
export const memberColumn = (children?) => {
let columns: ColumnType<any>[] = []
columns =
[
{
title: '序号',
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
dataIndex: 'name',
key: 'name',
align: 'left'
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
align: 'center'
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
},
{
title: '是否归属会员',
dataIndex: 'membershipOrNot',
key: 'membershipOrNot',
align: 'center',
render:(text:any) => (
text == 0 ?'否':'是'
)
},
{
title: '需求发送状态',
dataIndex: 'state',
key: 'state',
align: 'center',
render:(text:any,records,index) => children? children(text,records,index) :''
}
]
return columns
}
/**
* @description: 内部流转interiorRequisitionForms
* 外部流转 externalRequisitionForms
* @param {type}
* @return {type}
*/
export const externalColumn = (childeren,stateList?) => {
let culumn:ColumnType<any>[] = []
return culumn = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '状态',
dataIndex: 'state',
align: 'center',
key: 'state',
render:(text:any,record:any) => stateList(text)
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operationTime',
align: 'center',
key: 'operationTime',
render: (text: any, record: any) => childeren(text)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
align: 'left',
key: 'auditOpinion'
}
]
}
export const interiorColumn = (childeren,stateList?) => {
let culumn:ColumnType<any>[] = []
return culumn = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作人',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
key: 'department',
},
{
title: '职位',
dataIndex: 'position',
align: 'center',
key: 'position',
},
{
title: '状态',
dataIndex: 'state',
align: 'center',
key: 'state',
render:(text:any,record:any) => stateList(text)
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operationTime',
align: 'center',
key: 'operationTime',
render: (text: any, record: any) => childeren(text)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
align: 'left',
key: 'auditOpinion'
}
]
}
......
...@@ -19,11 +19,11 @@ import { ...@@ -19,11 +19,11 @@ import {
import { history } from 'umi' import { history } from 'umi'
import { LinkOutlined, PlusOutlined, QuestionCircleOutlined, MinusOutlined, MinusCircleOutlined } from '@ant-design/icons' import { LinkOutlined, PlusOutlined, QuestionCircleOutlined, MinusOutlined, MinusCircleOutlined } from '@ant-design/icons'
import { Row, Col, Card, Button, Table, Popconfirm, Radio,DatePicker, import { Row, Col, Card, Button, Table, Popconfirm, Radio,DatePicker,
Form, Spin, Select, Cascader, Tabs, Input, Tooltip, Space } from 'antd'; Form, Spin, Select,Switch, Cascader, Tabs, Input, Tooltip, Space } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import moment from 'moment' import moment from 'moment'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { dockingColumn } from './detailFormColumnType' import { memberColumn } from '../../common/detailFormColumnType'
import { getAuth} from '@/utils/auth' import { getAuth} from '@/utils/auth'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import styles from './templateForm.less'; import styles from './templateForm.less';
...@@ -41,6 +41,7 @@ import { ...@@ -41,6 +41,7 @@ import {
import { store } from '@/store' import { store } from '@/store'
import colorTag from '@/pages/logistics/colorTag' import colorTag from '@/pages/logistics/colorTag'
import { Effects } from 'bizcharts' import { Effects } from 'bizcharts'
import { check } from 'prettier'
const { TabPane } = Tabs const { TabPane } = Tabs
const {TextArea} = Input const {TextArea} = Input
...@@ -112,6 +113,7 @@ const Detail: React.FC<{}> = () => { ...@@ -112,6 +113,7 @@ const Detail: React.FC<{}> = () => {
const [categoryId, setcategoryId] = useState(null)//选择的分类id const [categoryId, setcategoryId] = useState(null)//选择的分类id
const [otherList, setotherList] = useState([])//动态tab循环 const [otherList, setotherList] = useState([])//动态tab循环
const [dockingList, setdockingList] = useState([])//需求列表 const [dockingList, setdockingList] = useState([])//需求列表
const [memberList, setmemberList] = useState([])
const [productSource, setproductSource] = useState([])//商品列表 新增 const [productSource, setproductSource] = useState([])//商品列表 新增
const [shipperAddressList, setshipperAddressList] = useState([]) const [shipperAddressList, setshipperAddressList] = useState([])
const [CategoryTreeOne, setCategoryTreeOne] = useState([]) const [CategoryTreeOne, setCategoryTreeOne] = useState([])
...@@ -280,6 +282,61 @@ const Detail: React.FC<{}> = () => { ...@@ -280,6 +282,61 @@ const Detail: React.FC<{}> = () => {
// setShowCategory(null) // setShowCategory(null)
} }
/**
* @description: 需求格式
* @param {type}
* @return {type}
*/
const dockingColumn: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员名称',
dataIndex: 'memberName',
key: 'memberName',
align: 'left'
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
align: 'center'
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
},
{
title: '是否归属会员',
dataIndex: 'membershipOrNot',
key: 'membershipOrNot',
align: 'center',
render:(text:any) => (
text == 0 ?'否':'是'
)
},
{
title: '需求发送状态',
dataIndex: 'state',
key: 'state',
align: 'center'
}
]
const equiryColumns: ColumnType<any>[] = [ const equiryColumns: ColumnType<any>[] = [
{ {
...@@ -328,8 +385,10 @@ const Detail: React.FC<{}> = () => { ...@@ -328,8 +385,10 @@ const Detail: React.FC<{}> = () => {
// 会员添加弹窗控制 // 会员添加弹窗控制
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
setproductSource(memberRowCtl.selectRow) memberRowCtl.selectRow.forEach((v) => {
console.log('memberRowCtl.selectRow',memberRowCtl.selectRow) v['state'] = true
})
setmemberList(memberRowCtl.selectRow)
} }
const [pagination, setPagination] = useState({ const [pagination, setPagination] = useState({
...@@ -560,7 +619,17 @@ const Detail: React.FC<{}> = () => { ...@@ -560,7 +619,17 @@ const Detail: React.FC<{}> = () => {
console.log('item',item) console.log('item',item)
}) })
values['voucherTime'] = null values['voucherTime'] = null
values['memberIds'] = [] values['memberIds'] = []// memberRowCtl.selectedRowKeys
if(platType == 3){
values['memberIds'] = memberList.filter((v)=> v.state).map(v => {
return v.memberId
})
}else if(platType == 2){
values['memberIds'] = dockingList.filter((v)=> v.state).map(v => {
return v.memberId
})
}
values['demandDockings'] = [] values['demandDockings'] = []
values['requisitionFormProducts'] = [...productList] values['requisitionFormProducts'] = [...productList]
console.log('productList',productList) console.log('productList',productList)
...@@ -620,6 +689,15 @@ const Detail: React.FC<{}> = () => { ...@@ -620,6 +689,15 @@ const Detail: React.FC<{}> = () => {
}; };
console.log('Received values of form: ', values); console.log('Received values of form: ', values);
} }
const switchState = (text,record,index) => {
console.log(66,text,record,index)
return <Switch defaultChecked={text?true: false} size="small" onChange={(checked)=> {
console.log(checked);
memberList[index].state = checked
setmemberList([...memberList])
}} />
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
...@@ -1027,12 +1105,14 @@ const Detail: React.FC<{}> = () => { ...@@ -1027,12 +1105,14 @@ const Detail: React.FC<{}> = () => {
</Space> </Space>
{ {
platType == 3 && platType == 3 &&
<Button style={{ marginBottom: 16, marginTop: 24 }} block icon={<PlusOutlined />} onClick={() => handleOptionBtn(2)} type='dashed'>选择会员</Button> <>
<Button style={{ marginBottom: 16, marginTop: 24 }} block icon={<PlusOutlined />} onClick={() => handleOptionBtn(2)} type='dashed'>选择会员</Button>
<Table rowKey={"id"} dataSource={memberList} columns={memberColumn(switchState)} pagination={pagination} />
</>
} }
{ {
platType != 1 && ( platType != 1 && platType != 3 )&&
<Table dataSource={dockingList} rowSelection={rowSelection} columns={dockingColumn} pagination={pagination} /> <Table rowKey={"id"} dataSource={dockingList} columns={dockingColumn} pagination={pagination} />
} }
......
import {action, computed, observable, runInAction} from 'mobx' import {action, computed, observable, runInAction} from 'mobx'
import { IChannelProductModule } from '@/module/channelProductModule'; // mobx要用到的数据类型 import { IChannelProductModule } from '@/module/channelProductModule'; // mobx要用到的数据类型
import { GetProductChannelCommodityGetCommodityListResponseDetail, GetProductChannelCommodityGetCommodityUnitPriceResponse } from '@/services';
/** /**
* 渠道直采商品 * 渠道直采商品
...@@ -7,12 +8,13 @@ import { IChannelProductModule } from '@/module/channelProductModule'; // mobx ...@@ -7,12 +8,13 @@ import { IChannelProductModule } from '@/module/channelProductModule'; // mobx
class ChannelProductStore implements IChannelProductModule { class ChannelProductStore implements IChannelProductModule {
// 选择商品区块 // 选择商品区块
@observable public productSelectRowInStore: any = null; @observable public productSelectRowInStore: GetProductChannelCommodityGetCommodityListResponseDetail = null;
@observable public priceType: number = null @observable public priceType: number = null
@observable public productName: string = null @observable public productName: string = null
@observable public currentActiveKey: string = '1' @observable public currentActiveKey: string = '1'
@observable public currentOperateChannel: string = null @observable public currentOperateChannel: string = null
@observable public tableDataInSetPrice: GetProductChannelCommodityGetCommodityUnitPriceResponse[] = null
// 加工接口返回的数据,用户编辑回显数据 // 加工接口返回的数据,用户编辑回显数据
// @computed // @computed
...@@ -23,7 +25,7 @@ class ChannelProductStore implements IChannelProductModule { ...@@ -23,7 +25,7 @@ class ChannelProductStore implements IChannelProductModule {
// } // }
@action.bound @action.bound
public setProductSelectRowInStore(data: any) { public setProductSelectRowInStore(data: GetProductChannelCommodityGetCommodityListResponseDetail) {
this.productSelectRowInStore = data; this.productSelectRowInStore = data;
} }
...@@ -47,6 +49,11 @@ class ChannelProductStore implements IChannelProductModule { ...@@ -47,6 +49,11 @@ class ChannelProductStore implements IChannelProductModule {
this.currentOperateChannel = data; this.currentOperateChannel = data;
} }
@action.bound
public setTableDataInSetPrice(data: GetProductChannelCommodityGetCommodityUnitPriceResponse[]){
this.tableDataInSetPrice = data;
}
} }
export default ChannelProductStore export default ChannelProductStore
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