浏览代码

进度统计

wushaodong 4 年之前
父节点
当前提交
5030ea0e38

+ 3 - 2
jscore/pages/Sales/BrowseImage.js

@@ -24,9 +24,8 @@ const SCREEN_HEIGHT = Dimensions.get('window').height;
 
 //const IMAGE_PLACEHOLDER = require('../../../assets/images/bg_mine_header.png');
 let subjectImages = [];
+let _subjectRows = {};
 
-let _subjectRows = {}, _answerRows = {};
-const baseURL = SyncStorage.get('baseURL');
 class Row extends Component {
 
     constructor(props) {
@@ -54,6 +53,7 @@ class Row extends Component {
 
     render() {
         const {row, id} = this.props;
+        const baseURL = SyncStorage.get('baseURL');
         const style = this.calcSize(row);
         const height = Math.floor((SCREEN_WIDTH * row.height) / row.width) + 20;
         const url = baseURL + row.picture
@@ -102,6 +102,7 @@ class BrowseImage extends Component {
     };
 
     renderSubjectItem(item, index) {
+        const baseURL = SyncStorage.get('baseURL');
         subjectImages.push({url: baseURL+item.picture});
         return (
                 <TouchableOpacity onPress={() => this._zoomImage(index, 'S')}>

+ 5 - 2
jscore/pages/Sales/ReviewTodayList.js

@@ -19,6 +19,7 @@ class ReviewTodayList extends Component {
             rows: 10,
             page: 1,
             status: this.props.navigation.state.params.status, //默认查询正常客户
+            searchText: '',
         };
     }
 
@@ -44,11 +45,12 @@ class ReviewTodayList extends Component {
         });
     };
 
-    doSearch = (stage_progress, event, param) => {
+    doSearch = (stage_progress, event, param, searchText) => {
         this.state.stage_progress = stage_progress
         this.state.count_param = event
         this.state.param = param
         this._fetchData(1);
+        this.setState({searchText})
     };
 
     componentDidMount() {
@@ -155,9 +157,10 @@ class ReviewTodayList extends Component {
                     onHeaderRefresh={() => this._fetchData(1)}
                     onFooterRefresh={() => this._fetchMore()}
                 />
-                <View style={ComponentsStyles.bottomTotal}>
+                <View style={[ComponentsStyles.bottomTotal,{flexDirection: 'row',}]}>
                     <Text style={ComponentsStyles.totalText}>合计数量:<Text
                         style={{color: '#333333'}}>{total}</Text></Text>
+                    <Text style={{color:'green', textAlign:'right', flex:1}}>{this.state.searchText}</Text>
                 </View>
             </View>
         );

+ 10 - 8
jscore/pages/Sales/SearchProcess.js

@@ -18,6 +18,7 @@ class SearchProcess extends Component {
             data: [],
             StageCount: [],
             field: '',
+            field_name: '',
             store_id: '',
         };
     }
@@ -48,16 +49,17 @@ class SearchProcess extends Component {
 
     _onClickLeaf = (item) => {
         this._fetchStageCount(item.item.field, item.item.id);
-        this.setState({field: item.item.field, store_id: item.item.id});
+        this.setState({field: item.item.field, field_name: item.item.name, store_id: item.item.id});
     };
 
-    _onStagePress = (stage_id, event) => {
-        const {field, store_id} = this.state;
+    _onStagePress = (stage_id, event, text) => {
+        const {field, store_id, field_name} = this.state;
         let param = '';
         if (field && store_id) {
             param = field + '_' + store_id;
         }
-        this.state.callback(stage_id, event, param);
+        const searchText = field_name + '-' + text
+        this.state.callback(stage_id, event, param, searchText);
         this.props.navigation.goBack();
     };
 
@@ -65,16 +67,16 @@ class SearchProcess extends Component {
         return (
             <View style={index % 2 === 0 ? styles.tableRowOdd : styles.tableRowEven}>
                 <Text
-                    onPress={() => this._onStagePress(data.stage_id, 'stage')}
+                    onPress={() => this._onStagePress(data.stage_id, 'stage', '总数')}
                     style={[styles.tableCell, {width: '30%'}]}>{data.stage}</Text>
                 <Text
-                    onPress={() => this._onStagePress(data.stage_id, 'total')}
+                    onPress={() => this._onStagePress(data.stage_id, 'total', '总数')}
                     style={[styles.tableCell, {width: '20%'}]}>{data.total_count}</Text>
                 <Text
-                    onPress={() => this._onStagePress(data.stage_id, 'today')}
+                    onPress={() => this._onStagePress(data.stage_id, 'today', '今日')}
                     style={[styles.tableCell, {width: '25%'}]}>{data.today_count}</Text>
                 <Text
-                    onPress={() => this._onStagePress(data.stage_id, 'overdue')}
+                    onPress={() => this._onStagePress(data.stage_id, 'overdue', '逾期')}
                     style={[styles.tableCell, {width: '25%'}]}>{data.overdue_count}</Text>
             </View>
         );

+ 1 - 1
jscore/utils/storage.js

@@ -39,4 +39,4 @@ export default {
   remove,
   multiGet,
   multiRemove,
-}
+}