Browse Source

统计传值

test01 3 years ago
parent
commit
8aff5e57a1

+ 2 - 0
js/component/common/projectOperation/index.jsx

@@ -31,6 +31,8 @@ class ProjectOperation extends Component{
             patentTypeList:[],
             patentTypeList:[],
 
 
             loading:false,
             loading:false,
+
+            patentTransfer:props.dataInfor.patentTransfer
         }
         }
         this.onSubmit = this.onSubmit.bind(this);
         this.onSubmit = this.onSubmit.bind(this);
         this.httpChange = this.httpChange.bind(this);
         this.httpChange = this.httpChange.bind(this);

+ 15 - 5
js/component/common/tabelContent/autoCompleteSearch.jsx

@@ -7,23 +7,32 @@ class AutoCompleteSearch extends Component{
         super(props);
         super(props);
         this.state={
         this.state={
             contactsOption:[],
             contactsOption:[],
-            autoCompleteSearchLoading:false
+            autoCompleteSearchLoading:false,
+            searchValue:props.config.searchValue
         }
         }
         this.onSelect = this.onSelect.bind(this);
         this.onSelect = this.onSelect.bind(this);
         this.onSearch = this.onSearch.bind(this);
         this.onSearch = this.onSearch.bind(this);
     }
     }
 
 
-    onSelect(value){
-        this.props.onSelect(value)
+    onSelect(value,option){
+        let arr = this.state.contactsOption.filter(v=>v.value === value);
+        this.setState({
+            searchValue:arr[0]['value']
+        })
+        this.props.onSelect(value,option.props.children)
     }
     }
 
 
     onSearch(value){
     onSearch(value){
+        if(this.state.autoCompleteSearchLoading){
+            this.ajax && this.ajax.abort();
+        }
         this.setState({
         this.setState({
-            autoCompleteSearchLoading: true
+            autoCompleteSearchLoading: true,
+            searchValue: value
         });
         });
         let data = {};
         let data = {};
         data[this.props.config.search] = value
         data[this.props.config.search] = value
-        $.ajax({
+        this.ajax = $.ajax({
             method: "get",
             method: "get",
             dataType: "json",
             dataType: "json",
             crossDomain: false,
             crossDomain: false,
@@ -64,6 +73,7 @@ class AutoCompleteSearch extends Component{
         return (
         return (
             <Spin spinning={this.state.autoCompleteSearchLoading}>
             <Spin spinning={this.state.autoCompleteSearchLoading}>
                 <AutoComplete
                 <AutoComplete
+                    value={this.state.searchValue}
                     dataSource={customerOptions}
                     dataSource={customerOptions}
                     style={{ width: 200 }}
                     style={{ width: 200 }}
                     onSelect={this.onSelect}
                     onSelect={this.onSelect}

+ 107 - 103
js/component/common/tabelContent/index.jsx

@@ -30,7 +30,7 @@ class TabelContent extends Component{
                     return "共" + total + "条数据";
                     return "共" + total + "条数据";
                 }
                 }
             },
             },
-            searchValues:{},
+            searchValues:this.props.searchConfig || {},
             contactsOption:[]
             contactsOption:[]
         }
         }
         this.loadData= this.loadData.bind(this);
         this.loadData= this.loadData.bind(this);
@@ -43,28 +43,29 @@ class TabelContent extends Component{
         this.setState({
         this.setState({
             loading:true
             loading:true
         })
         })
-        let data = {
+        let searchInfor = {
             pageNo: pageNo || 1,
             pageNo: pageNo || 1,
             pageSize: this.state.pagination.pageSize,
             pageSize: this.state.pagination.pageSize,
         }
         }
         if(this.props.query){
         if(this.props.query){
-            data = Object.assign(data,this.props.query);
+            searchInfor = Object.assign(searchInfor,this.props.query);
         }
         }
         if(Object.keys(this.state.searchValues).length > 0){
         if(Object.keys(this.state.searchValues).length > 0){
-            data = Object.assign(data,this.state.searchValues);
+            searchInfor = Object.assign(searchInfor,this.state.searchValues);
         }
         }
         $.ajax({
         $.ajax({
             method: "get",
             method: "get",
             dataType: "json",
             dataType: "json",
             crossDomain: false,
             crossDomain: false,
             url: globalConfig.context + this.props.tabelApi,
             url: globalConfig.context + this.props.tabelApi,
-            data,
+            data:searchInfor,
             success: function(data) {
             success: function(data) {
                 ShowModal(this);
                 ShowModal(this);
                 this.setState({
                 this.setState({
                     loading:false
                     loading:false
                 })
                 })
                 if (data.error && data.error.length === 0) {
                 if (data.error && data.error.length === 0) {
+                    this.props.searchOperation && this.props.searchOperation(searchInfor);
                     if(data.data.list){
                     if(data.data.list){
                         this.state.pagination.current = data.data.pageNo;
                         this.state.pagination.current = data.data.pageNo;
                         this.state.pagination.total = data.data.totalCount;
                         this.state.pagination.total = data.data.totalCount;
@@ -206,106 +207,109 @@ class TabelContent extends Component{
                         <div className="user-search" style={{paddingTop:'10px'}}>
                         <div className="user-search" style={{paddingTop:'10px'}}>
                             <Form layout="inline">
                             <Form layout="inline">
                                 {
                                 {
-                                    (this.props.searchList || []).map((v,k)=>(
-                                        v.type === 'text' ?
-                                            <FormItem label={v.title}>
-                                                <Input
-                                                    key={k}
-                                                    placeholder={v.placeholder}
-                                                    value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
-                                                    style={v.style ? v.style : { width: 150, marginRight: 10}}
-                                                    onChange={(e) => {
-                                                        searchValues[v.dataKey] = e.target.value
-                                                        this.setState({
-                                                            searchValues:  searchValues
-                                                        });
-                                                    }}
-                                                />
-                                            </FormItem> :
-                                            v.type === 'autoComplete' ?
-                                                <AutoCompleteSearch
-                                                    onSelect={(value)=>{
-                                                        searchValues[v.dataKey] = value
-                                                        this.setState({
-                                                            searchValues:  searchValues
-                                                        });
-                                                    }}
-                                                    config={v}
-                                                />
-                                                :
-                                            v.type === 'select' || v.type === 'departmentSelect' ?
-                                                <FormItem label={v.title} style={{marginTop:'-8px'}}>
-                                                    <Spin spinning={this.state.departmentLoading}>
-                                                        {
-                                                            <Select
-                                                                key={k}
-                                                                placeholder={v.placeholder}
-                                                                style={v.style ? v.style : { width:200,marginRight: 10}}
-                                                                value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
-                                                                onChange={(e) => {
-                                                                    searchValues[v.dataKey] = String(e);
-                                                                    if(v.type === 'departmentSelect'){
-                                                                        let arr = this.state.contactsOption.filter(v=>String(v.value) === String(e))
-                                                                        searchValues['depName'] = arr[0].label;
-                                                                    }
-                                                                    this.setState({
-                                                                        searchValues:  searchValues
-                                                                    });
-                                                                }}>
+                                    (this.props.searchList || []).map((v,k)=>{
+                                        return (
+                                            v.type === 'text' ?
+                                                <FormItem label={v.title}>
+                                                    <Input
+                                                        key={k}
+                                                        placeholder={v.placeholder}
+                                                        value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
+                                                        style={v.style ? v.style : { width: 150, marginRight: 10}}
+                                                        onChange={(e) => {
+                                                            searchValues[v.dataKey] = e.target.value
+                                                            this.setState({
+                                                                searchValues:  searchValues
+                                                            });
+                                                        }}
+                                                    />
+                                                </FormItem> :
+                                                v.type === 'autoComplete' ?
+                                                    <AutoCompleteSearch
+                                                        onSelect={(value,title)=>{
+                                                            searchValues[v.dataKey] = value
+                                                            if(v.dataTitle){searchValues[v.dataTitle] = title}
+                                                            this.setState({
+                                                                searchValues:  searchValues
+                                                            });
+                                                        }}
+                                                        config={v}
+                                                    />
+                                                    :
+                                                    v.type === 'select' || v.type === 'departmentSelect' ?
+                                                        <FormItem label={v.title} style={{marginTop:'-8px'}}>
+                                                            <Spin spinning={this.state.departmentLoading}>
                                                                 {
                                                                 {
-                                                                    v.selectOptionList ?
-                                                                        v.selectOptionList():
-                                                                        (
-                                                                            v.type === 'departmentSelect' ?
-                                                                                this.state.contactsOption :
-                                                                                (v.selectList || [])
-                                                                        ).map((v)=>(
-                                                                            <Select.Option
-                                                                                key={v.value}
-                                                                                value={v.value}
-                                                                            >
-                                                                                {v.label}
-                                                                            </Select.Option>
-                                                                        ))
+                                                                    <Select
+                                                                        key={k}
+                                                                        placeholder={v.placeholder}
+                                                                        style={v.style ? v.style : { width:200,marginRight: 10}}
+                                                                        value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
+                                                                        onChange={(e) => {
+                                                                            searchValues[v.dataKey] = String(e);
+                                                                            if(v.type === 'departmentSelect'){
+                                                                                let arr = this.state.contactsOption.filter(v=>String(v.value) === String(e))
+                                                                                searchValues['depName'] = arr[0].label;
+                                                                            }
+                                                                            this.setState({
+                                                                                searchValues:  searchValues
+                                                                            });
+                                                                        }}>
+                                                                        {
+                                                                            v.selectOptionList ?
+                                                                                v.selectOptionList():
+                                                                                (
+                                                                                    v.type === 'departmentSelect' ?
+                                                                                        this.state.contactsOption :
+                                                                                        (v.selectList || [])
+                                                                                ).map((v)=>(
+                                                                                    <Select.Option
+                                                                                        key={v.value}
+                                                                                        value={v.value}
+                                                                                    >
+                                                                                        {v.label}
+                                                                                    </Select.Option>
+                                                                                ))
+                                                                        }
+                                                                    </Select>
                                                                 }
                                                                 }
-                                                            </Select>
-                                                        }
-                                                    </Spin>
-                                                </FormItem>: v.type === 'times' ?
-                                                <FormItem label={v.title}>
-                                                    {
-                                                        v.format === 'YYYY/MM' ?
-                                                            <MonthPicker
-                                                                value={searchValues[v.dataKey] ? moment(searchValues[v.dataKey]) : null}
-                                                                style={{marginRight:'10px',marginTop: '2px'}}
-                                                                onChange={(data, dataString) => {
-                                                                    searchValues[v.dataKey] = String(dataString);
-                                                                    this.setState({
-                                                                        searchValues:  searchValues
-                                                                    });
-                                                                }}
-                                                            />:
-                                                            <RangePicker
-                                                                style={{marginRight:'10px',marginTop: '2px'}}
-                                                                value={[
-                                                                    searchValues[v.dataKey[0]]
-                                                                        ? moment(searchValues[v.dataKey[0]])
-                                                                        : null,
-                                                                    searchValues[v.dataKey[1]]
-                                                                        ? moment(searchValues[v.dataKey[1]])
-                                                                        : null,
-                                                                ]}
-                                                                onChange={(data, dataString) => {
-                                                                    searchValues[v.dataKey[0]] = String(dataString[0]);
-                                                                    searchValues[v.dataKey[1]] = String(dataString[1]);
-                                                                    this.setState({
-                                                                        searchValues:  searchValues
-                                                                    });
-                                                                }}
-                                                            />
-                                                    }
-                                                </FormItem>: null
-                                    ))
+                                                            </Spin>
+                                                        </FormItem>: v.type === 'times' ?
+                                                        <FormItem label={v.title}>
+                                                            {
+                                                                v.format === 'YYYY/MM' ?
+                                                                    <MonthPicker
+                                                                        value={searchValues[v.dataKey] ? moment(searchValues[v.dataKey]) : null}
+                                                                        style={{marginRight:'10px',marginTop: '2px'}}
+                                                                        onChange={(data, dataString) => {
+                                                                            searchValues[v.dataKey] = String(dataString);
+                                                                            this.setState({
+                                                                                searchValues:  searchValues
+                                                                            });
+                                                                        }}
+                                                                    />:
+                                                                    <RangePicker
+                                                                        style={{marginRight:'10px',marginTop: '2px'}}
+                                                                        value={[
+                                                                            searchValues[v.dataKey[0]]
+                                                                                ? moment(searchValues[v.dataKey[0]])
+                                                                                : null,
+                                                                            searchValues[v.dataKey[1]]
+                                                                                ? moment(searchValues[v.dataKey[1]])
+                                                                                : null,
+                                                                        ]}
+                                                                        onChange={(data, dataString) => {
+                                                                            searchValues[v.dataKey[0]] = String(dataString[0]);
+                                                                            searchValues[v.dataKey[1]] = String(dataString[1]);
+                                                                            this.setState({
+                                                                                searchValues:  searchValues
+                                                                            });
+                                                                        }}
+                                                                    />
+                                                            }
+                                                        </FormItem>: null
+                                        )
+                                    })
                                 }
                                 }
                                 <Button type="primary" onClick={()=>{
                                 <Button type="primary" onClick={()=>{
                                     this.loadData();
                                     this.loadData();

+ 148 - 129
js/component/manageCenter/customer/operationalData/signatureStatistics/detailedList.jsx

@@ -155,136 +155,144 @@ class DetailedList extends Component{
                     key: "financeName",
                     key: "financeName",
                 },
                 },
             ],
             ],
+            searchList:[
+                {
+                    type:'departmentSelect',
+                    dataKey:'depId',
+                    placeholder:'请选择部门'
+                },
+                {
+                    type:'times',
+                    title:'下单时间',
+                    dataKey:['startCreate','endCreate'],
+                },
+                {
+                    type:'times',
+                    title:'合同时间',
+                    dataKey:['startSign','endSign'],
+                },
+                {
+                    type:'select',
+                    dataKey:'sort',
+                    placeholder:'请选择排序',
+                    selectList:[
+                        {
+                            value:'0',
+                            label:'按总金额排序'
+                        },
+                        {
+                            value:'1',
+                            label:'按数量排序'
+                        },
+                    ]
+                },
+            ],
+            searchList1:[
+                {
+                    type:'text',
+                    dataKey:'orderNo',
+                    placeholder:'请输入订单编号'
+                },
+                {
+                    type:'text',
+                    dataKey:'name',
+                    placeholder:'请输入客户名称'
+                },
+                {
+                    type:'departmentSelect',
+                    dataKey:'depId',
+                    placeholder:'请选择部门'
+                },
+                {
+                    type:'text',
+                    dataKey:'contractNo',
+                    placeholder:'请输入合同编号'
+                },
+                {
+                    type:'select',
+                    dataKey:'liquidationStatus',
+                    placeholder:'请选择结算状态',
+                    selectList:[
+                        {
+                            value:'0',
+                            label:'首付待付请'
+                        },
+                        {
+                            value:'1',
+                            label:'尾款待付清'
+                        },
+                        {
+                            value:'2',
+                            label:'已付清'
+                        }
+                    ]
+                },
+                {
+                    type:'select',
+                    dataKey:'approval',
+                    placeholder:'请选择特批状态',
+                    selectList:[
+                        {
+                            value:'0',
+                            label:'非特批'
+                        },
+                        {
+                            value:'1',
+                            label:'特批'
+                        }
+                    ]
+                },
+                {
+                    type:'select',
+                    dataKey:'amountStatus',
+                    placeholder:'请选择签单金额',
+                    selectList:[
+                        {
+                            value:'0',
+                            label:'10万元以下'
+                        },
+                        {
+                            value:'1',
+                            label:'10~20万元'
+                        },
+                        {
+                            value:'2',
+                            label:'20~30万元'
+                        },
+                        {
+                            value:'3',
+                            label:'30~40万元'
+                        },
+                        {
+                            value:'4',
+                            label:'40万元以上'
+                        },
+                    ]
+                },
+                {
+                    type:'times',
+                    title:'下单时间',
+                    dataKey:['starTime','endTime'],
+                },
+                {
+                    type:'times',
+                    title:'合同时间',
+                    dataKey:['contractStart','contractEnd'],
+                },
+            ],
+            searchConfig:{},
         }
         }
     }
     }
 
 
-    searchList(){
-        let arr = [
-            {
-                type:'departmentSelect',
-                dataKey:'depId',
-                placeholder:'请选择部门'
-            },
-            {
-                type:'times',
-                title:'下单时间',
-                dataKey:['startCreate','endCreate'],
-            },
-            {
-                type:'times',
-                title:'合同时间',
-                dataKey:['startSign','endSign'],
-            },
-            {
-                type:'select',
-                dataKey:'sort',
-                placeholder:'请选择排序',
-                selectList:[
-                    {
-                        value:'0',
-                        label:'按总金额排序'
-                    },
-                    {
-                        value:'1',
-                        label:'按数量排序'
-                    },
-                ]
-            },
-        ]
-        return arr;
-    }
-
-    searchList1(){
-        let arr = [
-            {
-                type:'text',
-                dataKey:'orderNo',
-                placeholder:'请输入订单编号'
-            },
-            {
-                type:'text',
-                dataKey:'name',
-                placeholder:'请输入客户名称'
-            },
-            {
-                type:'departmentSelect',
-                dataKey:'depId',
-                placeholder:'请选择部门'
-            },
-            {
-                type:'text',
-                dataKey:'contractNo',
-                placeholder:'请输入合同编号'
-            },
-            {
-                type:'select',
-                dataKey:'liquidationStatus',
-                placeholder:'请选择结算状态',
-                selectList:[
-                    {
-                        value:'0',
-                        label:'首付待付请'
-                    },
-                    {
-                        value:'1',
-                        label:'尾款待付清'
-                    },
-                    {
-                        value:'2',
-                        label:'已付清'
-                    }
-                ]
-            },
-            {
-                type:'select',
-                dataKey:'approval',
-                placeholder:'请选择特批状态',
-                selectList:[
-                    {
-                        value:'0',
-                        label:'非特批'
-                    },
-                    {
-                        value:'1',
-                        label:'特批'
-                    }
-                ]
-            },
-            {
-                type:'select',
-                dataKey:'amountStatus',
-                placeholder:'请选择签单金额',
-                selectList:[
-                    {
-                        value:'0',
-                        label:'10万元以下'
-                    },
-                    {
-                        value:'1',
-                        label:'10~20万元'
-                    },
-                    {
-                        value:'2',
-                        label:'20~30万元'
-                    },
-                    {
-                        value:'3',
-                        label:'30~40万元'
-                    },
-                    {
-                        value:'4',
-                        label:'40万元以上'
-                    },
-                ]
-            },
-            {
-                type:'times',
-                title:'下单时间',
-                dataKey:['starTime','endTime'],
-            },
-        ]
-        return arr;
-    }
+    // componentWillMount() {
+    //     if(this.props.searchConfig['orderNo']){
+    //         this.state.searchList[0]['searchValue'] = this.props.searchConfig['orderNoTitle'];
+    //         console.log(this.state.searchList)
+    //         this.setState({
+    //             searchList:this.state.searchList
+    //         })
+    //     }
+    // }
 
 
     render() {
     render() {
         return (
         return (
@@ -301,9 +309,19 @@ class DetailedList extends Component{
                     <div className="user-content">
                     <div className="user-content">
                         <TabelContent
                         <TabelContent
                             scroll={{ x: 0, y: 200}}
                             scroll={{ x: 0, y: 200}}
-                            searchList={this.searchList()}
+                            searchList={this.state.searchList}
                             columns={this.state.columns}
                             columns={this.state.columns}
                             tabelApi={'/api/admin/newOrder/provinceStatisticsList'}
                             tabelApi={'/api/admin/newOrder/provinceStatisticsList'}
+                            searchConfig={this.props.searchConfig}
+                            searchOperation={(value)=>{
+                                for(let i of Object.keys(value)){
+                                    if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
+                                        delete value[i]
+                                    }
+
+                                }
+                                this.setState({searchConfig:value})}
+                            }
                             exportApi={'/api/admin/newOrder/provinceStatisticsListExprot'}
                             exportApi={'/api/admin/newOrder/provinceStatisticsListExprot'}
                             query={{
                             query={{
                                 province:this.props.recordInfor.id,
                                 province:this.props.recordInfor.id,
@@ -339,8 +357,9 @@ class DetailedList extends Component{
                         className="admin-desc-content">
                         className="admin-desc-content">
                         <div className="user-content">
                         <div className="user-content">
                             <TabelContent
                             <TabelContent
-                                searchList={this.searchList1()}
+                                searchList={this.state.searchList1}
                                 columns={this.state.columns1}
                                 columns={this.state.columns1}
+                                searchConfig={this.state.searchConfig}
                                 tabelApi={'/api/admin/newOrder/orderNewList'}
                                 tabelApi={'/api/admin/newOrder/orderNewList'}
                                 query={{
                                 query={{
                                     specially:7,
                                     specially:7,

+ 19 - 0
js/component/manageCenter/customer/operationalData/signatureStatistics/index.jsx

@@ -66,11 +66,20 @@ class SignatureStatistics extends Component{
                     }
                     }
                 },
                 },
             ],
             ],
+            searchConfig:{}
         }
         }
     }
     }
 
 
     searchList(){
     searchList(){
         let arr = [
         let arr = [
+            // {
+            //     type:'autoComplete',
+            //     dataKey:'orderNo',
+            //     dataTitle:'orderNoTitle',
+            //     api:'/api/admin/customer/listAdminByName',
+            //     search:'adminName',
+            //     placeholder:'请输入客户名称'
+            // },
             {
             {
                 type:'departmentSelect',
                 type:'departmentSelect',
                 dataKey:'depId',
                 dataKey:'depId',
@@ -137,6 +146,15 @@ class SignatureStatistics extends Component{
                     scroll={{ x: 0, y: 200 }}
                     scroll={{ x: 0, y: 200 }}
                     searchList={this.searchList()}
                     searchList={this.searchList()}
                     columns={this.state.columns}
                     columns={this.state.columns}
+                    searchOperation={(value)=>{
+                        for(let i of Object.keys(value)){
+                            if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
+                                delete value[i]
+                            }
+
+                        }
+                        this.setState({searchConfig:value})}
+                    }
                     tabelApi={'/api/admin/newOrder/statisticsList'}
                     tabelApi={'/api/admin/newOrder/statisticsList'}
                     exportApi={'/api/admin/newOrder/statisticsListExprot'}
                     exportApi={'/api/admin/newOrder/statisticsListExprot'}
                     exportExecProcessing={(data)=>{
                     exportExecProcessing={(data)=>{
@@ -157,6 +175,7 @@ class SignatureStatistics extends Component{
                     }}
                     }}
                 />
                 />
                 {this.state.visible ? <DetailedList
                 {this.state.visible ? <DetailedList
+                    searchConfig={this.state.searchConfig}
                     visible={this.state.visible}
                     visible={this.state.visible}
                     recordInfor={this.state.recordInfor}
                     recordInfor={this.state.recordInfor}
                     onCancel={()=>{
                     onCancel={()=>{