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