Commit 37a541c4 authored by GuanHua's avatar GuanHua
parents cccabf4f 0fdb080f
import React, { useState, useRef, useEffect } from 'react'
import { history } from 'umi'
import { Row, Col, Form, Input, Select, Popconfirm, Button, Card, Modal, Checkbox, Tooltip, message, Table } from 'antd';
import { Row, Col, Form, Input, Select, Popconfirm, Button, Card, Modal, Checkbox, Tooltip, message, Table, Radio } from 'antd';
import { LinkOutlined, QuestionCircleOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god'
......@@ -34,6 +34,7 @@ const AddAtttribute: React.FC<{}> = () => {
const [formValue, setFormValue] = useState<any>({})
const [queryId, setQueryId] = useState('') // 判断编辑依据
const [isSee, setIsSee] = useState(false) // 判断查看依据
const [isSpecial, setIsSpecial] = useState(false) //特殊属性禁用展示方式
useEffect(() => {
const { location } = history
......@@ -134,11 +135,18 @@ const AddAtttribute: React.FC<{}> = () => {
setRoleVisible(true)
let menuFormData = menuForm.getFieldValue('attribute')
console.log(formValue, 'formValue', menuFormData)
//@ts-ignore
let chooseKey = menuFormData && menuFormData.id || null
setSelectedRowKeys([chooseKey])
}
// 特殊属性切换
const onChangeSpecial = (e, type) => {
if(type === 'isDate')
menuForm.setFieldsValue({isArea: false})
if(type === 'isArea')
menuForm.setFieldsValue({isDate: false})
}
return <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
......@@ -205,7 +213,7 @@ const AddAtttribute: React.FC<{}> = () => {
},
]}
>
<Select placeholder="选择展示方式" disabled={isSee}>
<Select placeholder="选择展示方式" disabled={isSee||isSpecial}>
<Option value={1}>单选</Option>
<Option value={2}>多选</Option>
<Option value={3}>输入</Option>
......@@ -233,7 +241,8 @@ const AddAtttribute: React.FC<{}> = () => {
</Tooltip>
</Col> */}
<Col span={24}>
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled={isSee}>价格属性</Checkbox></Form.Item>
{/* 规格属性 -> 原价格属性 */}
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled={isSee}>规格属性</Checkbox></Form.Item>
<Tooltip title="勾选后对于此属性的每个属性值会在商品发布时按属性设置不同的价格!">
<InfoCircleOutlined />
</Tooltip>
......@@ -244,6 +253,23 @@ const AddAtttribute: React.FC<{}> = () => {
<InfoCircleOutlined />
</Tooltip>
</Col>
{/* 日期 地区属性 */}
<Col span={24}>
<Form.Item name="isDate" valuePropName="checked" initialValue={false} noStyle>
<Checkbox onChange={(e) => onChangeSpecial(e, 'isDate')} disabled={isSee}>日期属性</Checkbox>
</Form.Item>
<Tooltip title="勾选后此属性作为日期属性,日期属性的属性值无需在属性值管理中设置,系统自动取自然日作为属性值">
<InfoCircleOutlined />
</Tooltip>
</Col>
<Col span={24}>
<Form.Item name="isArea" valuePropName="checked" initialValue={false} noStyle>
<Checkbox onChange={(e) => onChangeSpecial(e, 'isArea')} disabled={isSee}>地区属性</Checkbox>
</Form.Item>
<Tooltip title="勾选后此属性作为地区属性,地区属性的属性值无需手工在属性值管理中设置,系统自动取地区数据作为属性值">
<InfoCircleOutlined />
</Tooltip>
</Col>
</Row>
</Form.Item>
</Col>
......@@ -333,12 +359,13 @@ const AddAtttribute: React.FC<{}> = () => {
</Row>
<Modal
title="关联平台属性"
visible={roleVisible}
visible={roleVisible}
onOk={handleSelectOk}
onCancel={()=>setRoleVisible(false)}
okText="确认"
cancelText="取消"
width={704}
destroyOnClose={true}
>
<StandardTable
columns={columns}
......
......@@ -181,7 +181,7 @@ const AddPropertyValue: React.FC<{}> = () => {
<Col span={20} style={{display: 'none'}}><Form.Item name={['attributeValue', 'id']}><Input disabled /></Form.Item></Col>
<Col span={20}><Form.Item name={['attributeValue', 'value']}><Input disabled /></Form.Item></Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} style={{backgroundColor: '#6B778C', borderColor: '#6B778C'}} onClick={handleLink}>
<Button type="primary" icon={<LinkOutlined />} style={{backgroundColor: '#6B778C', borderColor: '#6B778C'}} onClick={handleLink} disabled={isSee}>
关联
</Button>
</Col>
......
......@@ -262,18 +262,24 @@ const AddProducts: React.FC<{}> = (props) => {
}
})
}).then( e => {
console.log(e, 'e')
setIsEnableCheck(false)
if(e)
message.error(e.message)
console.log(e, 'e')
}).catch(error => {
console.log(error, '_error')
setIsEnableCheck(false)
if(error.messge)
message.error(error.message)
else
message.error(error.errorFields[0].errors.toString())
console.log(error, '_error')
})
}catch(e){
setIsEnableCheck(false)
message.error(e.message)
console.log(e,'error')
}
}
......
......@@ -342,7 +342,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
/**
* @description SUK组合
* @description SKU组合
* @param {[[],[]..]} chunks 传入不同的属性值数组进行组合
*/
const SKUCombine = (arr: any[]) => {
......
......@@ -74,6 +74,14 @@ const ProductDescFormDefualt: React.FC<Iprops> = (props) => {
action: '/api/file/file/upload',
showUploadList: false,
data: { fileType: UPLOAD_TYPE },
// beforeUpload(file) {
// console.log(file, 'video file')
// const isVideo = file.type === 'video/mp4' || file.type === 'image/png';
// if (!isVideo) {
// message.error('请上传视频文件!');
// }
// return isVideo
// },
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList, 'video files');
......
......@@ -140,19 +140,19 @@ const DirectChannel: React.FC<{}> = () => {
</>
: ''}
{(record.status===4) &&
<>
<Button type='link' onClick={()=>clickUp(1, record.id)}>上架</Button>
<Dropdown overlay={
<Menu>
<Menu.Item><Button type='link' onClick={()=>clickModify(record.id)}>修改</Button></Menu.Item>
<Menu.Item><Button type='link' onClick={()=>clickDelete(record.id)}>删除</Button></Menu.Item>
</Menu>
}>
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
更多 <CaretDownOutlined />
</a>
</Dropdown>
</>
<>
<Button type='link' onClick={()=>clickUp(1, record.id)}>上架</Button>
<Dropdown overlay={
<Menu>
<Menu.Item><Button type='link' onClick={()=>clickModify(record.id)}>修改</Button></Menu.Item>
<Menu.Item><Button type='link' onClick={()=>clickDelete(record.id)}>删除</Button></Menu.Item>
</Menu>
}>
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
更多 <CaretDownOutlined />
</a>
</Dropdown>
</>
}
</>
......
......@@ -126,33 +126,33 @@ const FastModifyPrice: React.FC<{}> = () => {
component = (<span style={{ padding: '2px 5px', background: 'rgba(244,245,247,1)', borderRadius: '4px' }}>已下架</span>)
return component
},
filters: [
{
text: '待提交审核',
value: 1,
},
{
text: '待审核',
value: 2,
},
{
text: '审核通过',
value: 3,
},
{
text: '审核不通过',
value: 4,
},
{
text: '已上架',
value: 5,
},
{
text: '已下架',
value: 6,
}
],
onFilter: (value, record) => record.status === value,
// filters: [
// {
// text: '待提交审核',
// value: 1,
// },
// {
// text: '待审核',
// value: 2,
// },
// {
// text: '审核通过',
// value: 3,
// },
// {
// text: '审核不通过',
// value: 4,
// },
// {
// text: '已上架',
// value: 5,
// },
// {
// text: '已下架',
// value: 6,
// }
// ],
// onFilter: (value, record) => record.status === value,
},
{
title: '操作',
......@@ -262,7 +262,7 @@ const FastModifyPrice: React.FC<{}> = () => {
console.log(_priceRange)
// @ts-ignore
PublicApi.postProductCommodityUpdateCommodityPrice({ commodityId: currentRow.id, unitPriceAndPicId: currentRow.commodityId, unitPrice: _priceRange }).then(res => {
if(res.code === 100){
if(res.code === 1000){
ref.current.reload()
setModifyModal(false)
}
......
import {action, computed, observable, runInAction} from 'mobx'
import { IChannelProductModule, IRole, IChannel } from '@/module/channelProductModule'; // mobx要用到的数据类型
import { GetProductChannelCommodityGetCommodityListResponseDetail, GetProductChannelCommodityGetCommodityUnitPriceResponse } from '@/services';
import { IChannelProductModule, IRole, IChannel } from '@/module/channelProductModule';
/**
* 渠道直采商品
......@@ -8,12 +7,12 @@ import { GetProductChannelCommodityGetCommodityListResponseDetail, GetProductCha
class ChannelProductStore implements IChannelProductModule {
// 选择商品区块
@observable public productSelectRowInStore: GetProductChannelCommodityGetCommodityListResponseDetail = null;
@observable public productSelectRowInStore: any = null;
@observable public priceType: number = null
@observable public productName: string = null
@observable public currentActiveKey: string = '1'
@observable public currentOperateChannel: IChannel = null
@observable public tableDataInSetPrice: GetProductChannelCommodityGetCommodityUnitPriceResponse[] = null
@observable public tableDataInSetPrice: any[] = null
@observable public selectedRole: IRole = null
......@@ -26,7 +25,7 @@ class ChannelProductStore implements IChannelProductModule {
// }
@action.bound
public setProductSelectRowInStore(data: GetProductChannelCommodityGetCommodityListResponseDetail) {
public setProductSelectRowInStore(data: any) {
this.productSelectRowInStore = data;
}
......@@ -51,7 +50,7 @@ class ChannelProductStore implements IChannelProductModule {
}
@action.bound
public setTableDataInSetPrice(data: GetProductChannelCommodityGetCommodityUnitPriceResponse[]){
public setTableDataInSetPrice(data: any[]){
this.tableDataInSetPrice = data;
}
......
import {action, computed, observable, runInAction} from 'mobx'
import { IProductModule, IProductSelectAttribute, IBasicFormParam, IPriceAttributeParam, IOtherParam, IDecsParams } from '@/module/productModule'; // mobx要用到的数据类型
import { GetProductGoodsGetGoodsListResponseDetail } from '@/services';
class ProductStore implements IProductModule {
@observable public attributeLists: any[] = [];
@observable public productName: string = "";
@observable public productSelectAttribute: IProductSelectAttribute[] = [];
@observable public selectedGoods: GetProductGoodsGetGoodsListResponseDetail[] = [];
@observable public selectedGoods: any[] = [];
@observable public tableDataSource: any[] = [];
@observable public priceAttributeParams: any[] = [];
@observable public productAttributeAndImageParams: any[] = [];
......@@ -94,7 +93,7 @@ class ProductStore implements IProductModule {
}
@action.bound
public setSelectedGoods(list: GetProductGoodsGetGoodsListResponseDetail[]) {
public setSelectedGoods(list: any[]) {
this.selectedGoods = list;
}
......
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