Browse Source

Merge branch 'master' of ssh://git.jishutao.com:55555/jishutao/kede-client

dengzhiguo 6 years ago
parent
commit
1f1ac9f092

+ 14 - 2
js/component/manageCenter/financialManage/bonus/jsBonus.jsx

@@ -67,7 +67,9 @@ const JsBonus = React.createClass({
                 orderNo:this.state.orderNoSearch,
                 startTime: this.state.releaseDate[0],
                 endTime: this.state.releaseDate[1],
-                grantStatus: this.state.grantStatus
+                grantStatus: this.state.grantStatus,
+                startTime1: this.state.createDate[0],
+                endTime1: this.state.createDate[1],
             },
             success: function (data) {
                 let theArr = [];
@@ -122,6 +124,7 @@ const JsBonus = React.createClass({
         return {
             searchMore: true,
             releaseDate: [],
+            createDate:[],
             RowData:{},
             execState:false,
             selectedRowKeys: [],
@@ -288,7 +291,9 @@ const JsBonus = React.createClass({
             targetName: this.state.projectMenSearch,//项目负责人
             startTime: this.state.releaseDate[0],
             endTime: this.state.releaseDate[1],
-            grantStatus: this.state.grantStatus
+            grantStatus: this.state.grantStatus,
+            startTime1: this.state.createDate[0],
+            endTime1: this.state.createDate[1],
         }
         window.location.href=(globalConfig.context+'/api/admin/bonus/exportTechnicianBonusData?'+$.param(data));
     },
@@ -322,6 +327,7 @@ const JsBonus = React.createClass({
         this.state.orderRefundSearch='';
         this.state.projectMenSearch='';
         this.state.releaseDate = [];
+        this.state.createDate=[];
         this.state.orderNoSearch='';
         this.state.grantStatus=undefined;
         this.state.departmenttList=undefined;
@@ -386,6 +392,12 @@ const JsBonus = React.createClass({
                             value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
                             this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
                             onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+                        <span>创建时间 :</span>
+                        <RangePicker
+                            format="YYYY-MM-DD"
+                            value={[this.state.createDate[0] ? moment(this.state.createDate[0]) : null,
+                            this.state.createDate[1] ? moment(this.state.createDate[1]) : null]}
+                            onChange={(data, dataString) => { this.setState({ createDate: dataString }); }} />    
                     </div>
                 </div>
                 <div className="patent-table" id="table">

+ 14 - 3
js/component/manageCenter/financialManage/bonus/yxBonus.jsx

@@ -66,7 +66,9 @@ const YxBonus = React.createClass({
                 orderNo:this.state.orderNoSearch,
                 startTime: this.state.releaseDate[0],
                 endTime: this.state.releaseDate[1],
-                grantStatus:this.state.grantStatus
+                grantStatus:this.state.grantStatus,
+                startTime1: this.state.createDate[0],
+                endTime1: this.state.createDate[1],
             },
             success: function (data) {
                 let theArr = [];
@@ -97,6 +99,7 @@ const YxBonus = React.createClass({
         return {
             searchMore: true,
             releaseDate: [],
+            createDate:[],
             RowData:{},
             execState:false,
             selectedRowKeys: [],
@@ -197,7 +200,7 @@ const YxBonus = React.createClass({
                     render:(text,recard)=>{
                         return <div>
                             {(recard.proofStatus&&!recard.grantStatus)?<Button type="primary" style={{marginRight:10}} onClick={(e)=>{e.stopPropagation(),this.proofread(recard,0)}}>发放</Button>:''}
-                             <Button type="primary" onClick={(e)=>{e.stopPropagation(),this.proofread(recard,1)}}>校对</Button>
+                             {recard.bonusSubject!='16'&&<Button type="primary" onClick={(e)=>{e.stopPropagation(),this.proofread(recard,1)}}>校对</Button>}
                         </div>
                     }
                 },
@@ -262,6 +265,8 @@ const YxBonus = React.createClass({
             startTime: this.state.releaseDate[0],
             endTime: this.state.releaseDate[1],
             grantStatus:this.state.grantStatus,
+            startTime1: this.state.createDate[0],
+            endTime1: this.state.createDate[1],
         }
         window.location.href=(globalConfig.context+'/api/admin/bonus/exportSaleBonusData?'+$.param(data));
     },
@@ -304,6 +309,7 @@ const YxBonus = React.createClass({
     reset() {
         this.state.orderRefundSearch='';
         this.state.releaseDate = [];
+        this.state.createDate=[];
         this.state.orderNoSearch='';
         this.state.departmenttList=undefined;
         this.state.grantStatus=undefined
@@ -369,7 +375,12 @@ const YxBonus = React.createClass({
                             value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
                             this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
                             onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
-                            
+                        <span>创建时间 :</span>
+                        <RangePicker
+                            format="YYYY-MM-DD"
+                            value={[this.state.createDate[0] ? moment(this.state.createDate[0]) : null,
+                            this.state.createDate[1] ? moment(this.state.createDate[1]) : null]}
+                            onChange={(data, dataString) => { this.setState({ createDate: dataString }); }} />        
                     </div>
                 </div>
                 <div className="patent-table" id="table">

+ 103 - 3
js/component/manageCenter/statistics/order/index.jsx

@@ -3,10 +3,12 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import '@/manageCenter/financialManage/distribute/public.less';
-import {  Button, Input, Spin, Table,Select, Switch, message, DatePicker,Upload} from 'antd';
+import {  Button, Input, Form,Spin,InputNumber, Table,Select, Switch, message, DatePicker,Upload,Modal} from 'antd';
 import {getNewOrderType,beforeUploadFile} from '@/tools';
 import {newOrderType} from '@/dataDic';
 import { exportExcel } from 'xlsx-oc';
+const FormItem = Form.Item;
+
 
 const Order = React.createClass({
     departmentList() {
@@ -68,8 +70,8 @@ const Order = React.createClass({
                 saleName: this.state.signName,//客户名称
                 departmentId:this.state.departmenttList,
                 type:orderN>=0?orderN+1:'',
-                month: mon1||Number((year+''+month)),
-                month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':month+1)),
+                month: mon1||Number(year+''+(month<10?('0'+month):month)),
+                month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':(month+1)<10?'0'+(month+1):(month+1))),
             },
             success: function (data) {
                 let theArr = [];
@@ -83,6 +85,7 @@ const Order = React.createClass({
                         theArr.push({
                             key: i+1,
                             id:thisdata.id,
+                            mid:thisdata.mid,
                             deptName:thisdata.deptName,
                             type:thisdata.type,
                             saleName:thisdata.saleName,  
@@ -163,11 +166,78 @@ const Order = React.createClass({
                     dataIndex: 'amount',
                     key: 'amount',
                 },
+                {
+                    title:'修改单量',
+                    dataIndex:'dl',
+                    key:'d1',
+                    render:(text,recard)=>{
+                        return <Button onClick={(e)=>{e.stopPropagation();this.modify(recard)}}>修改单量</Button>
+                    }
+                }
             ],
             dataSource: [],
             searchTime: [,]
         }
     },
+    //修改单量
+    modify(recard){
+        this.setState({
+            boHuiVisible:true,
+            recard,
+            result:recard.proofCount,
+            amount:recard.amount
+        })
+    },
+    bohuiOk(){
+        this.setState({
+            boHuiVisible:false
+        })
+        this.loadData(this.state.page);
+    },
+    boHuiCancel(){
+        this.setState({
+            boHuiVisible:false
+        })
+    },
+    boHuiSubmit(e){
+        e.preventDefault();
+        var resType = typeof this.state.result;
+        if(resType != 'number'){
+            message.warning('请填写校对信息');
+            return false;
+        };
+        var amountType = typeof this.state.amount;
+        if(amountType != 'number'){
+            message.warning('请填写金额');
+            return false;
+        };
+        this.setState({
+            loading:true
+        });
+        const recard = this.state.recard;
+        var api = '/api/admin/bonus/updateProof';
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + api,
+            data: {
+                id:recard.mid,
+                amount:this.state.amount,
+                proofCount:this.state.result
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('修改单量成功');
+                this.bohuiOk();
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
     componentWillMount() {
         this.loadData();
         this.departmentList();
@@ -210,6 +280,7 @@ const Order = React.createClass({
     render() { 
         const { RangePicker } = DatePicker;
         let departmentArr = this.state.departmentArr || [];
+        const recard = this.state.recard || {};
         return ( <div className="user-content">
             <div className="content-title">
                 <span>订单统计报表</span>
@@ -285,6 +356,35 @@ const Order = React.createClass({
                             />
                     </Spin>
                 </div>
+                <Modal visible={this.state.boHuiVisible} 
+                        width="400px" 
+                        title='修改单量'
+                        footer=''
+                        onOk={this.boHuiOk} 
+                        onCancel={this.boHuiCancel}
+                >
+                    <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
+			                <Spin spinning={this.state.loading}>
+                                <FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label={<span><strong style={{color:'#f00'}}>*</strong>单量校对结果</span>}>
+                                    <InputNumber min={0} max={1} placeholder="输入单量" 
+                                        value={this.state.result}
+                                        onChange={(e)=>{this.setState({result:e})}}
+                                    />
+                                </FormItem>   
+                                <FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label={<span><strong style={{color:'#f00'}}>*</strong>金额</span>}>
+                                    <InputNumber min={0} max={9999} placeholder="金额" 
+                                        value={this.state.amount}
+                                        onChange={(e)=>{this.setState({amount:e})}}
+                                    />
+                                    <span> 万元</span>
+                                </FormItem> 
+                                <FormItem wrapperCol={{ span: 12, offset:8 }}>  
+                                    <Button type="primary" htmlType="submit"  style={{marginRight:20}}>修改</Button>
+                                    <Button type="default" onClick={()=>{this.boHuiCancel()}}>取消</Button>
+                                </FormItem>
+                            </Spin>
+                        </Form>
+                </Modal>
         </div> )
     }
 })

+ 2 - 2
webpack.config.js

@@ -304,7 +304,7 @@ module.exports = (function () {
     }
 
     //let staticHost = 'http://afts.hnzhiming.com';
-    let staticHost = 'http://192.168.0.190';
+    let staticHost = 'http://192.168.0.188';
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://static.kedexinxi.com';
@@ -343,7 +343,7 @@ module.exports = (function () {
         // }
         devServer: {
             disableHostCheck: true,
-            host: '192.168.0.190',
+            host: '192.168.0.188',
             port: 80,
             allowedHosts: ['127.0.0.1','192.168.0.20','192.168.0.99'],
             headers: {