瀏覽代碼

no message

outaozhen 5 年之前
父節點
當前提交
7f49993349

+ 0 - 52
src/common/lockDetail/store/actionCreators.js

@@ -1,52 +0,0 @@
-import * as constants from './constants';
-import { fromJS } from 'immutable';
-
-import axios from '../../../common/axios_auth.js';
-// import axios from 'axios';
-
-
-
-//actionType
-export const searchFocus = () => ({
-    type: constants.SEARCH_FOCUS
-});
-
-export const getList = () => {
-    return (dispatch) => {
-        axios.get('/api/submenuList.json').then((res) => {
-            const data = res.data;
-            dispatch(changeList(data.data));
-        }).catch(() => {
-            console.log('error');
-        })
-    }
-};
-
-export const changeInputValue = (value) => (  {
-    type: constants.CHANGE_INPUTVALUE,
-    data:fromJS(value),
-});
-
-const changeList = (data) => ({
-    type: constants.CHANGE_LIST,
-    data: fromJS(data),
-    // totalPage: Math.ceil(data.length / 10)
-});
-
-// export const searchBlur = () => ({
-// 	type: constants.SEARCH_BLUR
-// });
-
-// export const mouseEnter = () => ({
-// 	type: constants.MOUSE_ENTER
-// });
-
-// export const mouseLeave = () => ({
-// 	type: constants.MOUSE_LEAVE
-// });
-
-// export const changePage = (page) => ({
-// 	type: constants.CHANGE_PAGE,
-// 	page
-// });
-

+ 0 - 5
src/common/lockDetail/store/constants.js

@@ -1,5 +0,0 @@
-export const SEARCH_FOCUS = 'submenu/SEARCH_FOCUS';
-export const CHANGE_LIST ='submenu/CHANGE_LIST';
-export const CHANGE_INPUTVALUE ='submenu/CHANGE_INPUTVALUE';
-
-

+ 0 - 58
src/common/lockDetail/store/reducer.js

@@ -1,58 +0,0 @@
-import * as constants from './constants';
-//锁定state不可修改,导致错误y
-import { fromJS } from 'immutable';
-
-
-const defaultState = fromJS({
-    menu: 'hello submenu-t!!!',
-    list:[],
-    inputValue:'',
-
-});
-
-
-export default (state = defaultState, action) => {
-
-    // switch(action.type) {
-	// 	case constants.SEARCH_FOCUS:
-	// 		return state.set('focused', true);
-	// 	case constants.SEARCH_BLUR:
-	// 		return state.set('focused', false);
-	// 	case constants.CHANGE_LIST:
-	// 		return state.merge({
-	// 			list: action.data,
-	// 			totalPage: action.totalPage
-	// 		});
-	// 	case constants.MOUSE_ENTER:
-	// 		return state.set('mouseIn', true);
-	// 	case constants.MOUSE_LEAVE:
-	// 		return state.set('mouseIn', false);
-	// 	case constants.CHANGE_PAGE:
-	// 		return state.set('page', action.page);
-	// 	default:
-	// 		return state;
-	// }
-    if(action.type===constants.CHANGE_INPUTVALUE){
-        return state.set('inputValue',action.data);
-
-    }
-
-
-
-    if(action.type===constants.SEARCH_FOCUS){
-        return state.set('menu','clicke me');
-        // return {
-        //     menu:'clicke me'
-        // }
-    }
-    if(action.type===constants.CHANGE_LIST){
-        return state.set('list',action.data);
-        //return state.set('menu','clicke me');
-
-        // return state.merge({
-        //     list: action.data,
-        //     //totalPage: action.totalPage
-        // });
-    }
-    return state;
-}

+ 8 - 10
src/common/lockDetail/index.js

@@ -6,9 +6,10 @@ import { actionCreators } from './store';
 class lockDetailPopups extends PureComponent {
 
   render() {
-    const {} = this.props;
+    const {locksotreDetail} = this.props;
+    // let lockDetail2 = lockDetail.toJS();
     return (
-      <div className="modal fade" id="lock-detail" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+      <div className="modal fade" id="lockDetail" role="dialog" aria-hidden="true" data-backdrop="static">
     <div className="modal-dialog modal-xl">
       <div className="modal-content">
         <div className="dialog-sheet">
@@ -30,7 +31,7 @@ class lockDetailPopups extends PureComponent {
                 <div className="sheet-panel-form slimScroll1 mx-4">
                   <div className="form-header mt-3">
                     <div className="d-flex justify-content-between"><span className="text-muted">软件锁</span><span className="text-muted">出库于 2019年5月6日 14:55</span></div>
-                    <legend>HNYH-0654</legend>
+                    {/* <legend>{lockDetail2.key_num}</legend> */}
                   </div>
                   <div className="cldform clearfix">
                     <div className="cldform-line"></div>
@@ -191,25 +192,22 @@ class lockDetailPopups extends PureComponent {
   }
 
   handlelockDetailPopups(key) {
-    const { handlelockDetailPopups } = this.lockDetailPopups;
+    const { handlelockDetailPopups } = this.props;
     handlelockDetailPopups(key);
   }
-
 }
 
 const mapStateToProps = (state) => {
   return {
-    // popupsClientId: state.getIn(['popups', 'popupsClientId']),
-    // companyDetail: state.getIn(['popups', 'companyDetail']),
-    // loading: state.getIn(['popups', 'loading']),
+    locksotreDetail: state.getIn(['lockDetailPopups', 'locksotreDetail']),
   }
 }
 
 const mapDispathToProps = (dispatch) => {
   return {
     handlelockDetailPopups(key) {
-      // dispatch(actionCreators.changeLoading());
-      // dispatch(actionCreators.getCompanyDetail(key,error));
+      // console.log('dndn');
+      dispatch(actionCreators.getlocksotreDetail(key,error));
     },
   }
 }

+ 25 - 0
src/common/popupslockDetail/store/actionCreators.js

@@ -0,0 +1,25 @@
+import * as constants from './constants';
+import { fromJS } from 'immutable';
+
+import axios from '../../../common/axios_auth.js';
+// import axios from 'axios';
+
+
+export const getlocksotreDetail = (key,error) => {
+    return (dispatch) => {
+        axios.get(config.CLD2API + '/product/longle/'+key).then((res) => {
+            const data = res.data;
+            if (data.code === 200) {
+                dispatch({
+                    type: constants.CHANGE_LOCK_DETAIL,
+                    data: data.data,
+                });
+            } else {
+                error('公司详情请求失败');
+            }
+        }).catch((e) => {
+            error('公司详情请求失败');
+        })
+    }
+};
+

+ 2 - 0
src/common/popupslockDetail/store/constants.js

@@ -0,0 +1,2 @@
+export const CHANGE_LOCK_DETAIL = 'lockDetail/change_lock_detail';
+export const CHANGE_INPUT_VALUE = 'lockDetail/value';

src/common/lockDetail/store/index.js → src/common/popupslockDetail/store/index.js


+ 25 - 0
src/common/popupslockDetail/store/reducer.js

@@ -0,0 +1,25 @@
+import * as constants from './constants';
+//锁定state不可修改,导致错误y
+import { fromJS } from 'immutable';
+
+
+const defaultState = fromJS({
+    locksotreDetail: { staffDetial: {} },
+});
+
+
+export default (state = defaultState, action) => {
+	// let locksotreDetail = state.get('locksotreDetail').toJS();
+    switch (action.type) {
+		case constants.CHANGE_LOCK_DETAIL:
+			return state.merge({
+				locksotreDetail: fromJS(action.data)
+			});
+		// case constants.CHANGE_INPUT_VALUE:
+		// 	let condition={[action.data.field]:action.data.value};
+		// 	Object.assign(lockDetail, condition);
+		// 	return state.set('lockDetail', fromJS(lockDetail));
+		default:
+			return state;
+	}
+}

+ 4 - 2
src/contact/company/index.js

@@ -9,7 +9,7 @@ import 'antd/dist/antd.css';
 
 
 
-import Popups from '../../common/popupsCompany';
+import Popups from '../../common/popups';
 
 const radioStyle = {
   display: 'block',
@@ -159,7 +159,7 @@ class company extends PureComponent {
 
         </main>
 
-        <Popups  onRef={(ref) => popupsObj = ref} />
+        <Popups mainView={'company'} onRef={(ref) => popupsObj = ref} />
 
 
       </Fragment>
@@ -187,6 +187,7 @@ const mapStateToProps = (state) => {
     sortField: state.getIn(['company', 'sortField']),
     sort: state.getIn(['company', 'sort']),
     searchValue: state.getIn(['company', 'searchValue']),
+
     companyDetail: state.getIn(['popups', 'companyDetail']),
   }
 }
@@ -233,6 +234,7 @@ const mapDispathToProps = (dispatch) => {
     },
     //弹出详情页点击触发
     handleCompanyPopups(key) {
+
       popupsObj.handleCompanyPopups(key);
       // console.log(popupsObj);
       // console.log(key);

+ 8 - 7
src/product/lock_store/index.js

@@ -5,7 +5,7 @@ import StaffHeader from '../../common/staffHeader'
 import { Table, Input,Radio } from 'antd';
 import 'antd/dist/antd.css';
 import { actionCreators } from './store';
-import Popups from '../../common/lockDetail';
+import Popups from '../../common/popupslockDetail';
 //import { AudioOutlined } from '@ant-design/icons';
 
 const radioStyle = {
@@ -78,7 +78,7 @@ class lock_store extends PureComponent {
                       </ul>
                       <ul className="list-unstyled px-3 pt-2 mb-0 border-top">
                         <li className="mb-2">
-                          <Radio.Group onChange={(e) => handleLockstoreSort(pagination.toJS(), this.props, e)} value={sort}>
+                          <Radio.Group onChange={(e) => handleLockstoreSort(pagination.toJS(), this.props,e)} value={sort}>
                             <Radio style={radioStyle} value='DESC'>
                               降序
                             </Radio>
@@ -94,7 +94,7 @@ class lock_store extends PureComponent {
                 <div className="panel-container show">
                   <div className="panel-content">
                    <Table
-                    onChange={(pagination,sorter) => handleLockstoreList(pagination,sorter,this.props)}
+                    onChange={(pagination,sorter) => handleLockstoreList(pagination,this.props)}
                     pagination={pagination.toJS()}
                     bordered
                     dataSource={dataSource.toJS()}
@@ -116,6 +116,7 @@ class lock_store extends PureComponent {
       const{handleLockstoreList,pagination,initData}= this.props;
       // console.log(pagination.toJS());
       handleLockstoreList(pagination.toJS(),this.props);
+      // console.log(this.props);
       initData();
     }
 }
@@ -135,7 +136,7 @@ const mapStateToProps = (state) => {
       columnsNum:state.getIn(['lockstore', 'columnsNum']),
       sortField: state.getIn(['lockstore', 'sortField']),
       sort: state.getIn(['lockstore', 'sort']),
-      // locksotreDetail: state.getIn(['popups', 'locksotreDetail']),
+      locksotreDetail: state.getIn(['lockDetailPopups', 'locksotreDetail']),
     }
 }
 
@@ -146,7 +147,6 @@ const mapStateToProps = (state) => {
 const mapDispathToProps = (dispatch) => {
     return {
       handleColumnsShow(index) {
-        // console.log('kkk');
         dispatch(actionCreators.toggleColumns(index));
       },
       initData(){
@@ -154,7 +154,9 @@ const mapDispathToProps = (dispatch) => {
         dispatch(actionCreators.toggleSorter());
       },
       handleLockstoreList(pagination,support){
+        // console.log(support)
         dispatch(actionCreators.getLockstoreList(pagination,support));
+        
       },
       //排序设置
     handleLockstoreSortField(pagination, support, e) {
@@ -184,10 +186,9 @@ const mapDispathToProps = (dispatch) => {
       },
       handlelockDetailPopups(key) {
         popupsObj.handlelockDetailPopups(key);
-        // console.log('kjjj');
         // console.log(255);
       },
     }
 }
-
+//mapStateToProps接收,mapDispathToProps发送
 export default connect(mapStateToProps, mapDispathToProps)(lock_store);

+ 3 - 1
src/product/lock_store/store/actionCreators.js

@@ -62,13 +62,14 @@ export const getLockstoreList = (pagination,support,searchValue) =>{
         }
         // console.log();
         // console.log(config.CLD2API + '/contact/company')
-        axios.get(config.CLD2API + '/contact/company', {
+        axios.get(config.CLD2API + '/product/longle', {
             params: {
                 current: pagination.current,
                 pageSize: pagination.pageSize,
                 sortField:sortField,
                 sort:sort,
                 searchValue:searchValue,
+                
             },
         }).then((res) => {
             const data = res.data;
@@ -79,6 +80,7 @@ export const getLockstoreList = (pagination,support,searchValue) =>{
                     data: fromJS(data.data),
                     pagination: pagination,
                     recordsTotal:data.recordsTotal,
+                    support:support,
                     searchValue:searchValue,
                 });
             } else {

+ 31 - 31
src/product/lock_store/store/reducer.js

@@ -21,54 +21,54 @@ const defaultState = fromJS({
 	columns: [
 		{
 			title: '锁号',
-			dataIndex: 'companyname',
-			key: 'companyname',
+			dataIndex: 'key_num',
+			key: 'key_num',
 		},
 		{
 			title: '产品',
-			dataIndex: 'nature',
-			key: 'nature',
+			dataIndex: 'product',
+			key: 'product',
 		},
 		{
 			title: '办事处',
-			dataIndex: 'local',
-			key: 'local',
-		},
-		{
-			title: '出库时间',
-			dataIndex: 'address',
-			key: 'address',
-		},
-		{
-			title: '销售/借出/赠送时间',
-			dataIndex: 'ride',
-			key: 'ride',
+			dataIndex: 'category',
+			key: 'category',
 		},
+		// {
+		// 	title: '出库时间',
+		// 	dataIndex: 'make_day',
+		// 	key: 'make_day',
+		// },
+		// {
+		// 	title: '销售/借出/赠送时间',
+		// 	dataIndex: 'status',
+		// 	key: 'status',
+		// },
 		{
 			title: '责任人',
-			dataIndex: 'stay',
-			key: 'stay',
+			dataIndex: 'responsible',
+			key: 'responsible',
 		},
 		{
 			title: '状态',
-			dataIndex: 'remarks',
-			key: 'remarks',
+			dataIndex: 'statusT',
+			key: 'statusT',
 		},
 		{
 			title: '联系人',
-			dataIndex: 'webservice',
-			key: 'webservice',
+			dataIndex: 'client',
+			key: 'client',
 		},
 	],
 	columnsData: [
-		{ columnsName: '锁号', columnsValue: true, dataKey: "companyname" },
-		{ columnsName: '产品', columnsValue: true, dataKey: "nature" },
-		{ columnsName: '办事处', columnsValue: true, dataKey: "local" },
-		{ columnsName: '出库时间', columnsValue: true, dataKey: "address" },
-		{ columnsName: '销售/借出/赠送时间', columnsValue: true, dataKey: "ride" },
-		{ columnsName: '责任人', columnsValue: true, dataKey: "stay" },
-		{ columnsName: '状态', columnsValue: true, dataKey: "remarks" },
-		{ columnsName: '联系人', columnsValue: true, dataKey: "webservice" },
+		{ columnsName: '锁号', columnsValue: true, dataKey: "key_num" },
+		{ columnsName: '产品', columnsValue: true, dataKey: "product" },
+		{ columnsName: '办事处', columnsValue: true, dataKey: "category" },
+		// { columnsName: '出库时间', columnsValue: true, dataKey: "make_day" },
+		// { columnsName: '销售/借出/赠送时间', columnsValue: true, dataKey: "status" },
+		{ columnsName: '责任人', columnsValue: true, dataKey: "responsible" },
+		{ columnsName: '状态', columnsValue: true, dataKey: "statusT" },
+		{ columnsName: '联系人', columnsValue: true, dataKey: "client" },
 
 	],
 });
@@ -140,7 +140,7 @@ export default (state = defaultState, action) => {
 		case constants.CHANGE_LOCKSTORE_DATA:
 			let columnsDetail={
 				...columns[0],
-				render: (text, record) => <a onClick={() => action.props.handlelockDetailPopups(record.key)} href="#lockDetail" data-toggle="modal" data-target="#lockDetail"  >{text}</a>,
+				render: (text, record) => <a onClick={() => action.support.handlelockDetailPopups(record.key)} href="#lockDetail" data-toggle="modal" data-target="#lockDetail"  >{text}</a>,
 			}
 			columns[0] = columnsDetail;
 			// console.log(columnsDetail);