Commit 65698838 authored by 靳野's avatar 靳野

feat:完成pop功能

parent 57cf31c7
......@@ -8,6 +8,7 @@ const UserModel = {
state: {
currentUser: {},
homeInfo: {},
businessInfo: {},
},
effects: {
// *fetch(_, { call, put }) {
......
......@@ -126,7 +126,7 @@ class goodsManage extends Component {
};
render() {
const { treeData, permissions } = this.props;
const { treeData, permissions, isPopMode } = this.props;
const selectW = { width: 250 };
const iptNumWidth = { width: 118 };
const canEditable = permissions[GOOD_MANAGE.EDITABLE];
......@@ -242,7 +242,7 @@ class goodsManage extends Component {
>
导出
</Button>
{canEditable ? (
{canEditable && !isPopMode ? (
<FormItem style={{ float: 'right' }}>
<Popover content={content} onVisibleChange={this.handleVisibleChange}>
<Button type="primary" className={styles.button}>
......
......@@ -32,9 +32,10 @@ import LocalStroage from '@/utils/localStorage';
import configApi from '@/../config/env.config';
import { GoldCategory } from '@/config/app.config';
@connect(({ goodsManage, menu }) => ({
@connect(({ goodsManage, menu, user }) => ({
goodsManage,
permissions: menu.permissions,
businessInfo: user.businessInfo,
}))
class goodsManage extends Component {
state = {
......@@ -77,6 +78,8 @@ class goodsManage extends Component {
canEditable = false;
isPopMode = false;
componentDidMount() {
this.props.goodsManage.tableData = {};
this.categoryList(this.state.productType);
......@@ -250,6 +253,7 @@ class goodsManage extends Component {
};
onShowStockModal = async row => {
if (this.isPopMode) return;
const res = await apiQueryLastChangeLog(row.skuId);
let priceInfo = {
id: row.skuId,
......@@ -415,6 +419,7 @@ class goodsManage extends Component {
const {
goodsManage: { tableData = {} },
permissions,
businessInfo,
} = this.props;
const rowSelection = {
selectedRowKeys: this.state.selectedRowKeys,
......@@ -426,6 +431,7 @@ class goodsManage extends Component {
const canAddNormal = permissions[GOOD_MANAGE.ADD_NORMAL_GOODS];
const canAddTakeaway = permissions[GOOD_MANAGE.ADD_TAKEAWAY_GOODS];
this.canEditable = permissions[GOOD_MANAGE.EDITABLE];
this.isPopMode = businessInfo.supplierType === 'popBasic';
// console.log('serviceData', this.state.serviceData);
// console.log('shopList', this.shopList);
// console.log('treeData', this.state.treeData);
......@@ -445,19 +451,22 @@ class goodsManage extends Component {
>
新增商品
</Button>,
<Button
type="link"
key="btnDraft"
className={styles.button}
onClick={this.openDraftModal}
>
草稿箱
</Button>,
!this.isPopMode && (
<Button
type="link"
key="btnDraft"
className={styles.button}
onClick={this.openDraftModal}
>
草稿箱
</Button>
),
]
: ''}
<Spin spinning={this.state.createloading}>
<Card>
<SearchForm
isPopMode={this.isPopMode}
handleSearch={this.handleSearch}
onReset={this.onReset}
onLoad={this.onLoad}
......
......@@ -46,6 +46,7 @@ export const productType = [
export function column() {
const onChangeState = async ({ skuId, state }) => {
if (this.isPopMode) return;
confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
......@@ -61,6 +62,7 @@ export function column() {
});
};
const onShowAudit = row => {
if (this.isPopMode) return;
this.setState({
auditRow: row,
visibleAuditModal: true,
......@@ -218,19 +220,21 @@ export function column() {
align: 'center',
render: (_, row) => (
<div className={styles.actionBtn}>
{this.canEditable && (row.state === 4 || (row.state >= 5 && row.updateState !== 1)) && (
<Button
key="edit"
type="primary"
size="small"
className={styles.button}
onClick={() => {
this.serviceVisbleChange(row);
}}
>
修改
</Button>
)}
{this.canEditable &&
!this.isPopMode &&
(row.state === 4 || (row.state >= 5 && row.updateState !== 1)) && (
<Button
key="edit"
type="primary"
size="small"
className={styles.button}
onClick={() => {
this.serviceVisbleChange(row);
}}
>
修改
</Button>
)}
<Button
key="viewP"
type="primary"
......
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