Commit 9a714f0c by 小明

增加 ActionSheet 对应新增按钮操作

parent 0acf4c19
......@@ -71,7 +71,7 @@
},
"dependencies": {
"animate.css": "^3.5.2",
"antd": "^2.5.3",
"antd": "^1.6.5",
"babel-polyfill": "6.16.0",
"chalk": "1.1.3",
"compression": "1.6.2",
......
......@@ -74,9 +74,9 @@ class ActionSheet extends PureComponent { // eslint-disable-line react/prefer-st
rows.map((row) => {
let cols = _.range(4 * row, 4 * row + 3);
cols.map((col) => {
let button = this.props.button[col];
let button = this.props.buttons[col];
if (button) {
results.push(<Col span="6" className="action-sheet-links">
results.push(<Col span="6" className="action-sheet-links" key={row + col}>
<a
className="action-sheet-link"
href={button.need_permission? 'javascript:void(0);': button.path}
......@@ -107,6 +107,13 @@ class ActionSheet extends PureComponent { // eslint-disable-line react/prefer-st
if (buttonsLength > 0) {
rowfragment = (<Row>{results}</Row>);
}
let visable = {
display: 'block'
};
if(!this.state.visable) {
visable.display = 'none';
}
return (
<Row>
......@@ -114,7 +121,7 @@ class ActionSheet extends PureComponent { // eslint-disable-line react/prefer-st
span="24"
id="action-sheet-cover"
onClick={this.handleDestroy}
style={this.state.visable ? {display:'block'} : {display:'none'}}></Col>
style={visable}></Col>
<Col
span="24"
id="action-sheet-cover"
......
......@@ -9,7 +9,7 @@
<meta name="mobile-web-app-capable" content="yes">
<title>爱客进销存</title>
</head>
<body>
<body id="mobile_dashboard_index">
<div id="app"></div>
</body>
</html>
......@@ -23,7 +23,7 @@ class DashboardIndex extends PureComponent { // eslint-disable-line react/prefer
android_upgrade_image: this.props.android_upgrade_image,
org_id: this.props.org_id,
current_buttons: [], //当前按钮
actionSheetVisible: true, //ActionSheet 是否可见
actionSheetVisible: false, //ActionSheet 是否可见
statistic: {},
documents: [],
approvingDocuments: [],
......@@ -45,7 +45,112 @@ class DashboardIndex extends PureComponent { // eslint-disable-line react/prefer
supplier: 'assets/images/symbols.svg#supplier',
product: 'assets/images/symbols.svg#purchase'
},
new_buttons: [],
new_buttons: [
{
name: '新增采购订单',
need_permission: true,
subject: 'purchase_order',
act: 'new',
path: '#',
class: 'purchase_order',
image: 'assets/images/symbols.svg#purchase_order'
},
{
name: '新增销售订单',
need_permission: true,
subject: 'sale_order',
act: 'new',
path: '#',
class: 'sale_order',
image: 'assets/images/symbols.svg#sale'
},
{
name: '新增采购入库',
need_permission: true,
subject: 'purchase',
act: 'new',
category: 'in',
path: '#',
class: 'purchase',
image: 'assets/images/symbols.svg#purchase'
},
{
name: '新增采购退货',
need_permission: true,
subject: 'purchase',
act: 'new',
category: 'out',
path: '#',
class: 'purchase',
image: 'assets/images/symbols.svg#purchase'
},
{
name: '新增销售出库',
need_permission: true,
subject: 'sale',
act: 'new',
category: 'out',
path: '#',
class: 'sale',
image: 'assets/images/symbols.svg#sale'
},
{
name: '新增销售退货',
need_permission: true,
subject: 'sale',
act: 'new',
category: 'in',
path: '#',
class: 'sale',
image: 'assets/images/symbols.svg#sale'
},
{
name: '新增其他入库',
need_permission: true,
subject: 'storageio',
act: 'new',
category: 'in',
path: '#',
class: 'storageio-in',
image: 'assets/images/symbols.svg#storageio-in'
},
{
name: '新增其他出库',
need_permission: true,
subject: 'storageio',
act: 'new',
category: 'out',
path: '#',
class: 'storageio-out',
image: 'assets/images/symbols.svg#storageio-out'
},
{
name: '新增调拨单',
need_permission: true,
subject: 'storage_transfer',
act: 'new',
path: '#',
class: 'storage-transfer',
image: 'assets/images/symbols.svg#storage-transfer'
},
{
name: '开始盘点',
need_permission: true,
subject: 'check',
act: 'new',
path: '#',
class: 'check',
image: 'assets/images/symbols.svg#check'
}],
purchase_buttons: [],
sale_buttons: [],
search_buttons: [],
......@@ -77,7 +182,7 @@ class DashboardIndex extends PureComponent { // eslint-disable-line react/prefer
case 'other':
case 'new':
this.setState({
current_buttons: this.state[`${type}_buttons`],
current_buttons: this.state['new_buttons'],
actionSheetVisible: true
});
break;
......@@ -333,7 +438,7 @@ class DashboardIndex extends PureComponent { // eslint-disable-line react/prefer
actionSheetHidden = {this.actionSheetHidden}
handleSearch = {this.initialData}
onClick = {this.openActionsheet}
onClick = {this.openActionsheet.bind(this)}
documents = {this.state.documents}
hasPermission = {this.state.hasPermission}
icons = {this.state.icons}
......
......@@ -18,3 +18,4 @@
@import "./suppliers";
@import "./table";
@import "./warehouses";
@import "./system";
\ No newline at end of file
@import 'components/variables';
* {
outline: none !important;
box-sizing: border-box;
......
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