|
@@ -1,11 +1,8 @@
|
|
|
import React from 'react';
|
|
|
-import ReactDom from 'react-dom';
|
|
|
-import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
-import moment from 'moment';
|
|
|
-import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker } from 'antd';
|
|
|
-import {categoryState} from '@/dataDic.js';
|
|
|
-import {getCategoryState,splitUrl} from '@/tools.js';
|
|
|
+import { Form, Icon, Button, Input, Select, Spin, Table, message, Modal, Upload,Popconfirm } from 'antd';
|
|
|
+import {typeModule} from '@/dataDic.js';
|
|
|
+import {splitUrl,getTypeModule} from '@/tools.js';
|
|
|
//图片组件
|
|
|
const PicturesWall = React.createClass({
|
|
|
getInitialState() {
|
|
@@ -92,7 +89,7 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
id: thisdata.id,//品类ID
|
|
|
sort:thisdata.sort,//品类序号
|
|
|
number: thisdata.number,//品类编号
|
|
|
- module:thisdata.module?String(thisdata.module):undefined,
|
|
|
+ module:thisdata.module,
|
|
|
name: thisdata.name,//品类名称
|
|
|
layer:thisdata.layer,
|
|
|
superId:thisdata.superId,
|
|
@@ -153,6 +150,9 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
title: '上级品类',
|
|
|
dataIndex: 'superName',
|
|
|
key: 'superName',
|
|
|
+ render:(text)=>{
|
|
|
+ return text?text:'超级品类'
|
|
|
+ }
|
|
|
},{
|
|
|
title:'操作',
|
|
|
dataIndex: 'superName1',
|
|
@@ -160,7 +160,7 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
render:(text,recard)=>{
|
|
|
return (
|
|
|
<div>
|
|
|
- {recard.layer=='1'&&<Button onClick={(e)=>{e.stopPropagation();this.nextAdd(recard)}}>新建下级品类</Button>}
|
|
|
+ {recard.layer<2&&<Button onClick={(e)=>{e.stopPropagation();this.nextAdd(recard)}}>新建下级品类</Button>}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
@@ -223,13 +223,12 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
},
|
|
|
//整行删除
|
|
|
delectRow() {
|
|
|
- let deletedIds = '';
|
|
|
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
- let rowItem = this.state.selectedRows[idx];
|
|
|
- if (rowItem.id) {
|
|
|
- deletedIds=rowItem.id;
|
|
|
- };
|
|
|
- };
|
|
|
+ let deletedIds =[];
|
|
|
+ let rowItem = this.state.selectedRowKeys[0];
|
|
|
+ let data = this.state.dataSource ||[];
|
|
|
+ if (data.length) {
|
|
|
+ deletedIds.push(data[rowItem].id);
|
|
|
+ }
|
|
|
this.setState({
|
|
|
selectedRowKeys: [],
|
|
|
loading: deletedIds.length > 0
|
|
@@ -240,7 +239,7 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/jtBusiness/category/delete",
|
|
|
data: {
|
|
|
- id: deletedIds
|
|
|
+ id: deletedIds[0]
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -278,7 +277,7 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
data: {
|
|
|
name:this.state.name,
|
|
|
superId:this.state.superId,
|
|
|
- layer:this.state.addFirst?'2':'1',
|
|
|
+ layer:this.state.addFirst?((this.state.recrdAdd.layer)+1):'1',
|
|
|
module:this.state.module
|
|
|
}
|
|
|
}).done(function (data) {
|
|
@@ -447,9 +446,10 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
label="所属模块" >
|
|
|
{!this.state.addFirst? <Select value ={this.state.module} onChange={(e)=>{this.setState({module:e})}}>
|
|
|
- <Select.Option value='0'>科技服务</Select.Option>
|
|
|
- <Select.Option value="1">知识产权服务</Select.Option>
|
|
|
- </Select>:<span>{this.state.module?'知识产权服务':'科技服务'}</span>}
|
|
|
+ {typeModule.map(item=>{
|
|
|
+ return <Select.Option key={item.value} value={item.value}>{item.key}</Select.Option>
|
|
|
+ })}
|
|
|
+ </Select>:<span>{getTypeModule(recrdAdd.module)}</span>}
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
@@ -527,12 +527,11 @@ const BusinessCategory=Form.create()(React.createClass({
|
|
|
<span>{theData.layerName}</span>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
- <FormItem
|
|
|
- labelCol={{ span: 7 }}
|
|
|
- wrapperCol={{ span: 12 }}
|
|
|
- label="所属模块" >
|
|
|
-
|
|
|
- <span>{theData.module?'知识产权服务':'科技服务'}</span>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 7 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="所属模块" >
|
|
|
+ <span>{getTypeModule(theData.module)}</span>
|
|
|
</FormItem>
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|