mentoswzq лет назад: 4
Родитель
Сommit
69dc1f89e5

+ 2 - 1
js/component/manageCenter/components/checkProject/index.jsx

@@ -121,8 +121,9 @@ class CheckProject extends Component {
                   {/*存在支付节点时不显示第三方的申请付款*/}
                   {/*0-待审核 ,1-审核通过,2-审核拒绝 true [NULL]*/}
                   {/*this.props.startType   0外包  1供应商(不需要审核)*/}
+                  {/*record.status  0-未支付 1-待全款 ,2已全款  status=2的时候已经全款,按钮可以去掉了*/}
                   <Button disabled={
-                    !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1))
+                    !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && record.status !==2 )
                   } type="primary" onClick={() => {
                     this.setState({
                       previewPayVisible: true,

+ 2 - 1
js/component/manageCenter/project/task/myTask.jsx

@@ -2585,7 +2585,7 @@ const Task = React.createClass({
               cid: thisData.cid, //机构id
               costReduction: thisData.costReduction,//费减
               officiaCost: thisData.officiaCost,//费减
-              type: thisData.type   //0其他 1专利申请 2专利买卖
+              type: thisData.type,   //0其他 1专利申请 2专利买卖
             })
             type=thisData.type
           }
@@ -2664,6 +2664,7 @@ const Task = React.createClass({
               partyAmount: thisData.partyAmount, //付款
               partyTimes: thisData.partyTimes, //付款时间
               cid: thisData.cid, //机构id
+              status: thisData.status, //催款状态 0-未支付 1-待全款 ,2已全款   status=2的时候已经全款,申请付款按钮可以去掉了
             })
           }
 

+ 1 - 0
js/component/manageCenter/project/task/myTaskOutsource.jsx

@@ -1932,6 +1932,7 @@ const MyTaskOutsource = React.createClass({
               partyAmount: thisData.partyAmount, //付款
               partyTimes: thisData.partyTimes, //付款时间
               cid: thisData.cid, //机构id
+              status: thisData.status, //催款状态 0-未支付 1-待全款 ,2已全款   status=2的时候已经全款,申请付款按钮可以去掉了
             })
           }
           console.log(payNodeArr,'payNodeArr:')

+ 120 - 0
js/component/manageCenter/set/projectConfigure/addOfficialFeePrice.js

@@ -0,0 +1,120 @@
+import React,{Component} from "react";
+import {Form, Input, Button, Checkbox, Select, Spin} from 'antd';
+import $ from "jquery/src/ajax";
+import {message, Modal} from "antd";
+
+class AddOfficialFeePrice extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            loading: false
+        }
+    }
+
+    //增加 修改
+    addSoftWritingPriceFn(e) {
+        e.preventDefault();
+        this.props.form.validateFields((err, values) => {
+            if (!err) {
+                this.setState({
+                    loading: true
+                });
+                let api ;
+                if(Object.keys(this.props.infor).length){
+                    api = '/api/admin/company/updateOfficialFeePrice';
+                    values.id = this.props.infor.id;
+                } else {
+                    api = '/api/admin/company/addOfficialFeePrice';
+                }
+                $.ajax({
+                    method: "post",
+                    dataType: "json",
+                    crossDomain: false,
+                    url:globalConfig.context + api,
+                    data:values,
+                }).done(function (data) {
+                    this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success(Object.keys(this.props.infor).length ? '修改成功!' : '新增成功!');
+                        this.props.successFn();
+                    } else {
+                        message.warning(data.error[0].message);
+                    }
+                }.bind(this));
+            }
+        });
+    }
+
+    render() {
+        const { getFieldDecorator } = this.props.form;
+        return (
+            <Modal
+                className="customeDetails"
+                title={Object.keys(this.props.infor).length ? "修改" : "新增"}
+                width='350px'
+                visible={this.props.visible}
+                onCancel={this.props.onCancel}
+                footer={null}
+            >
+                <Spin spinning={this.state.loading}>
+                    <Form onSubmit={(e)=>{
+                        this.addSoftWritingPriceFn(e)
+                    }}>
+                        <Form.Item label="专利类型">
+                            {getFieldDecorator('type', {
+                                initialValue: this.props.infor.type,
+                                rules: [{ required: true, message: '请选择专利类型!' }],
+                            })(
+                                <Select style={{ width:'200px'}}>
+                                    <Select.Option value={0}>实用新型</Select.Option>
+                                    <Select.Option value={1}>外观专利</Select.Option>
+                                    <Select.Option value={2}>发明专利</Select.Option>
+                                </Select>
+                            )}
+                        </Form.Item>
+                        <Form.Item  label="金额">
+                            {getFieldDecorator('amount', {
+                                initialValue: this.props.infor.amount,
+                                rules: [{ required: true, message: '请输入金额!' }],
+                            })(
+                                <Input placeholder="请输入金额" type={'number'} style={{width:'250px'}}/>
+                            )}
+                        </Form.Item>
+                        <Form.Item  label="减缴比例85%">
+                            {getFieldDecorator('proportion85', {
+                                initialValue: this.props.infor.proportion85,
+                                rules: [{ required: true, message: '请输入减缴比例85%!' }],
+                            })(
+                                <Input placeholder="请输入减缴比例85%" type={'number'} style={{width:'250px'}}/>
+                            )}
+                        </Form.Item>
+                        <Form.Item  label="备注">
+                            {getFieldDecorator('remarks', {
+                                initialValue: this.props.infor.remarks,
+                                rules: [{ required: true, message: '请输入备注!' }],
+                            })(
+                                <Input placeholder="请输入备注" type={'textarea'} style={{width:'250px'}}/>
+                            )}
+                        </Form.Item>
+                        <Form.Item>
+                            <Button style={{
+                                width: '100%',
+                                marginTop: '18px',
+                            }} type="primary" htmlType="submit">
+                                {
+                                    Object.keys(this.props.infor).length ? '确定修改' : '确定添加'
+                                }
+                            </Button>
+                        </Form.Item>
+                    </Form>
+                </Spin>
+            </Modal>
+        )
+    }
+
+}
+
+const WrappedHorizontalLoginForm = Form.create()(AddOfficialFeePrice);
+export default WrappedHorizontalLoginForm

+ 85 - 63
js/component/manageCenter/set/projectConfigure/addSoftWritingPrice.js

@@ -1,5 +1,5 @@
 import React,{Component} from "react";
-import {Form, Input, Button, Checkbox, Select} from 'antd';
+import {Form, Input, Button, Checkbox, Select, Spin} from 'antd';
 import $ from "jquery/src/ajax";
 import {message, Modal} from "antd";
 
@@ -7,11 +7,11 @@ class AddSoftWritingPrice extends Component{
     constructor(props) {
         super(props);
         this.state={
-
+            loading: false
         }
     }
 
-    //增加
+    //增加 修改
     addSoftWritingPriceFn(e) {
         e.preventDefault();
         this.props.form.validateFields((err, values) => {
@@ -19,18 +19,25 @@ class AddSoftWritingPrice extends Component{
                 this.setState({
                     loading: true
                 });
+                let api ;
+                if(Object.keys(this.props.infor).length){
+                    api = '/api/admin/company/updateSoftWritingPrice';
+                    values.id = this.props.infor.id;
+                } else {
+                    api = '/api/admin/company/addSoftWritingPrice';
+                }
                 $.ajax({
                     method: "post",
                     dataType: "json",
                     crossDomain: false,
-                    url:globalConfig.context + '/api/admin/company/addSoftWritingPrice',
+                    url:globalConfig.context + api,
                     data:values,
                 }).done(function (data) {
                     this.setState({
                         loading: false
                     });
                     if (!data.error.length) {
-                        message.success('新增成功!');
+                        message.success(Object.keys(this.props.infor).length ? '修改成功!' : '新增成功!');
                         this.props.successFn();
                     } else {
                         message.warning(data.error[0].message);
@@ -45,69 +52,84 @@ class AddSoftWritingPrice extends Component{
         return (
             <Modal
                 className="customeDetails"
-                title="新增"
+                title={Object.keys(this.props.infor).length ? "修改" : "新增"}
                 width='350px'
                 visible={this.props.visible}
                 onCancel={this.props.onCancel}
                 footer={null}
             >
-                <Form onSubmit={(e)=>{
-                    this.addSoftWritingPriceFn(e)
-                }}>
-                    <Form.Item label="公司名称">
-                        {getFieldDecorator('companyName', {
-                            rules: [{ required: true, message: '请输入公司名称!' }],
-                        })(
-                            <Input placeholder="请输入公司名称" style={{width:'250px'}}/>
-                        )}
-                    </Form.Item>
-                    <Form.Item  label="单价">
-                        {getFieldDecorator('unitPrice', {
-                            rules: [{ required: true, message: '请输入单价!' }],
-                        })(
-                            <Input placeholder="请输入单价" type={'number'} style={{width:'250px'}}/>
-                        )}
-                    </Form.Item>
-                    <Form.Item  label="材料">
-                        {getFieldDecorator('material', {
-                            rules: [{ required: true, message: '请选择是否有材料!' }],
-                        })(
-                            <Select style={{ width:'200px'}}>
-                                <Select.Option value={0}>无</Select.Option>
-                                <Select.Option value={1}>有</Select.Option>
-                            </Select>
-                        )}
-                    </Form.Item>
-                    <Form.Item  label="加急天数">
-                        {getFieldDecorator('urgent', {
-                            rules: [{ required: true, message: '请选择加急天数!' }],
-                        })(
-                            <Select style={{ width:'200px'}}>
-                                <Select.Option value={0}>无加急</Select.Option>
-                                <Select.Option value={1}>加急3天</Select.Option>
-                                <Select.Option value={2}>加急4天</Select.Option>
-                                <Select.Option value={3}>加急5-10天</Select.Option>
-                                <Select.Option value={4}>加急11-15天</Select.Option>
-                                <Select.Option value={5}>加急16-20天</Select.Option>
-                                <Select.Option value={6}>加急21-25天</Select.Option>
-                                <Select.Option value={7}>加急26-30天</Select.Option>
-                            </Select>
-                        )}
-                    </Form.Item>
-                    <Form.Item  label="备注">
-                        {getFieldDecorator('remarks', {
-                            rules: [{ required: true, message: '请输入备注!' }],
-                        })(
-                            <Input placeholder="请输入备注" type={'textarea'} style={{width:'250px'}}/>
-                        )}
-                    </Form.Item>
-                    <Form.Item>
-                        <Button style={{
-                            width: '100%',
-                            marginTop: '18px',
-                        }} type="primary" htmlType="submit">确定添加</Button>
-                    </Form.Item>
-                </Form>
+                <Spin spinning={this.state.loading}>
+                    <Form onSubmit={(e)=>{
+                        this.addSoftWritingPriceFn(e)
+                    }}>
+                        <Form.Item  label="单价">
+                            {getFieldDecorator('unitPrice', {
+                                initialValue: this.props.infor.unitPrice,
+                                rules: [{ required: true, message: '请输入单价!' }],
+                            })(
+                                <Input placeholder="请输入单价" type={'number'} style={{width:'250px'}}/>
+                            )}
+                        </Form.Item>
+                        <Form.Item  label="材料">
+                            {getFieldDecorator('material', {
+                                initialValue: this.props.infor.material,
+                                rules: [{ required: true, message: '请选择是否有材料!' }],
+                            })(
+                                <Select style={{ width:'200px'}}>
+                                    <Select.Option value={0}>无</Select.Option>
+                                    <Select.Option value={1}>有</Select.Option>
+                                </Select>
+                            )}
+                        </Form.Item>
+                        <Form.Item  label="加急天数">
+                            {getFieldDecorator('urgent', {
+                                initialValue: this.props.infor.urgent,
+                                rules: [{ required: true, message: '请选择加急天数!' }],
+                            })(
+                                <Select style={{ width:'200px'}}>
+                                    <Select.Option value={0}>无加急</Select.Option>
+                                    <Select.Option value={1}>加急3天</Select.Option>
+                                    <Select.Option value={2}>加急4天</Select.Option>
+                                    <Select.Option value={3}>加急5-10天</Select.Option>
+                                    <Select.Option value={4}>加急11-15天</Select.Option>
+                                    <Select.Option value={5}>加急16-20天</Select.Option>
+                                    <Select.Option value={6}>加急21-25天</Select.Option>
+                                    <Select.Option value={7}>加急26-30天</Select.Option>
+                                </Select>
+                            )}
+                        </Form.Item>
+                        {Object.keys(this.props.infor).length ? <Form.Item label="状态">
+                            {getFieldDecorator('status', {
+                                initialValue: this.props.infor.status,
+                                rules: [{ required: true, message: '请输选择状态!' }],
+                            })(
+                                <Select style={{ width:'200px'}}>
+                                    <Select.Option value={0}>正常</Select.Option>
+                                    <Select.Option value={1}>停用</Select.Option>
+                                    <Select.Option value={2}>删除</Select.Option>
+                                </Select>
+                            )}
+                        </Form.Item> : <div/>}
+                        <Form.Item  label="备注">
+                            {getFieldDecorator('remarks', {
+                                initialValue: this.props.infor.remarks,
+                                rules: [{ required: true, message: '请输入备注!' }],
+                            })(
+                                <Input placeholder="请输入备注" type={'textarea'} style={{width:'250px'}}/>
+                            )}
+                        </Form.Item>
+                        <Form.Item>
+                            <Button style={{
+                                width: '100%',
+                                marginTop: '18px',
+                            }} type="primary" htmlType="submit">
+                                {
+                                    Object.keys(this.props.infor).length ? '确定修改' : '确定添加'
+                                }
+                            </Button>
+                        </Form.Item>
+                    </Form>
+                </Spin>
             </Modal>
             )
     }

+ 177 - 4
js/component/manageCenter/set/projectConfigure/officialFees.js

@@ -1,19 +1,192 @@
 import React,{Component} from 'react';
+import {Button, Input, message, Select, Spin, Table, Modal, Popconfirm} from "antd";
+import AddOfficialFeePrice from './addOfficialFeePrice'
+import $ from "jquery/src/ajax";
+import '../content.less';
 
 class OfficialFees extends Component{
     constructor(props) {
         super(props);
         this.state={
-
+            type:'',
+            dataSource: [],
+            columns: [
+                {
+                    title: '专利类型',
+                    dataIndex: 'type',
+                    key: 'type',
+                    render: (text) => {
+                        return text === 0 ? '实用新型' : text === 1 ? '外观专利' : '发明专利'
+                    }
+                },
+                {
+                    title: '全额(万元)',
+                    dataIndex: 'amount',
+                    key: 'amount',
+                },
+                {
+                    title: '减缴85%',
+                    dataIndex: 'proportion85',
+                    key: 'proportion85',
+                },
+                {
+                    title: '备注',
+                    dataIndex: 'remarks',
+                    key: 'remarks',
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'id',
+                    key: 'id',
+                    render: (text) => {
+                        return <div>
+                            <Popconfirm
+                                title="是否删除?"
+                                onConfirm={() => {
+                                    this.deleteOfficialFeePrice(text);
+                                }}
+                                okText="删除"
+                                cancelText="不删除"
+                            >
+                                <Button type="danger" onClick={(e) => {
+                                    e.stopPropagation()
+                                }}>
+                                    删除
+                                </Button>
+                            </Popconfirm>
+                        </div>
+                    }
+                },
+            ],
+            addSoftVisible: false,
+            infor: {},
         }
+        this.loadData = this.loadData.bind(this);
+        this.tableRowClick = this.tableRowClick.bind(this);
+        this.reset = this.reset.bind(this);
+    }
+
+    componentDidMount() {
+        this.loadData();
+    }
+
+    //搜索功能和初始列表加载
+    loadData() {
+        this.setState({
+            loading: true,
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/company/listOfficialFeePrice',
+            data: {
+                type:this.state.type,       //名称
+            },
+            success: function (data) {
+                if (!data.data || !data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    data.data.map((v,i)=>{v.key = i})
+                    this.setState({
+                        dataSource: data.data,
+                    });
+                };
+
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    }
+
+    tableRowClick(infor) {
+        this.setState({
+            addSoftVisible : true,
+            infor: infor
+        })
+    }
+
+    reset(){
+        this.setState({
+            type:'',       //名称
+        },()=>{
+            this.loadData();
+        })
+    }
+
+    //删除
+    deleteOfficialFeePrice(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url:globalConfig.context + '/api/admin/company/deleteOfficialFeePrice',
+            data:{
+                id: id
+            },
+        }).done(function (data) {
+            this.setState({
+                loading: false
+            });
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.loadData();
+            } else {
+                message.warning(data.error[0].message);
+            }
+        }.bind(this));
     }
 
     render() {
-        return (
-            <div>建设中...</div>
+        return(
+            <div className="user-content" >
+                <div className="content-title">
+                    <div className="user-search" style={{display:'flex',flexFlow:'row',marginBottom:'10px'}}>
+                        <span style={{marginLeft: 'auto'}}>
+                            <Button type="primary" size={'middle'} onClick={()=>{
+                                this.setState({
+                                    addSoftVisible : true
+                                })
+                            }}>
+                                增加
+                            </Button>
+                        </span>
+                    </div>
+                    <div className="patent-table">
+                        <Spin spinning={this.state.loading}>
+                            <Table columns={this.state.columns}
+                                   dataSource={this.state.dataSource}
+                                   pagination={false}
+                                   onRowClick={this.tableRowClick}/>
+                        </Spin>
+                    </div>
+                </div>
+                {this.state.addSoftVisible ? <AddOfficialFeePrice
+                    infor={this.state.infor}
+                    visible={this.state.addSoftVisible}
+                    onCancel={()=>{
+                        this.setState({
+                            addSoftVisible : false,
+                            infor: {},
+                        })
+                    }}
+                    successFn={()=>{
+                        this.loadData();
+                        this.setState({
+                            addSoftVisible : false,
+                            infor: {}
+                        })
+                    }}/> : <div/>}
+            </div>
         )
     }
-
 }
 
 export default OfficialFees

+ 46 - 26
js/component/manageCenter/set/projectConfigure/softwareConfigure.js

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {Button, Input, message, Select, Spin, Table, Modal, Popconfirm} from "antd";
+import {Button, Input, message, Select, Spin, Table, Tag, Popconfirm} from "antd";
 import AddSoftWritingPrice from './addSoftWritingPrice'
 import $ from "jquery/src/ajax";
 import '../content.less';
@@ -8,9 +8,9 @@ class SoftwareConfigure extends Component{
     constructor(props) {
         super(props);
         this.state={
-            cid:'',        //公司编号
-            urgent: '',    //加急
-            material: '',  //材料
+            companyName:'',        //公司名称
+            urgent: '',            //加急
+            material: '',          //材料
             pagination: {
                 defaultCurrent: 1,
                 defaultPageSize: 10,
@@ -74,26 +74,40 @@ class SoftwareConfigure extends Component{
                     key: 'remarks',
                 },
                 {
+                    title: '状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: (text) => {
+                        return text === 0 ? <Tag color="#87d068">正常</Tag> :
+                            text === 1 ? <Tag>停用</Tag> :  <Tag color="#f50">删除</Tag>
+                    }
+                },
+                {
                     title: '操作',
                     dataIndex: 'id',
                     key: 'id',
                     render: (text) => {
-                        return <Popconfirm
-                            title="是否删除?"
-                            onConfirm={() => {
-                                this.deleteSoftWritingPrice(text);
-                            }}
-                            okText="删除"
-                            cancelText="不删除"
-                        >
-                            <Button type="danger">
-                                删除
-                            </Button>
-                        </Popconfirm>
+                        return <div>
+                            <Popconfirm
+                                title="是否删除?"
+                                onConfirm={() => {
+                                    this.deleteSoftWritingPrice(text);
+                                }}
+                                okText="删除"
+                                cancelText="不删除"
+                            >
+                                <Button type="danger" onClick={(e) => {
+                                    e.stopPropagation()
+                                }}>
+                                    删除
+                                </Button>
+                            </Popconfirm>
+                        </div>
                     }
                 },
             ],
-            addSoftVisible: false
+            addSoftVisible: false,
+            infor: {},
         }
         this.loadData = this.loadData.bind(this);
         this.tableRowClick = this.tableRowClick.bind(this);
@@ -115,7 +129,7 @@ class SoftwareConfigure extends Component{
             crossDomain: false,
             url: globalConfig.context + '/api/admin/company/listSoftWritingPrice',
             data: {
-                cid:this.state.cid,       //公司编号
+                companyName:this.state.companyName,       //公司名称
                 urgent: this.state.urgent,    //加急
                 material: this.state.material,  //材料
             },
@@ -143,13 +157,16 @@ class SoftwareConfigure extends Component{
         }.bind(this));
     }
 
-    tableRowClick() {
-
+    tableRowClick(infor) {
+        this.setState({
+            addSoftVisible : true,
+            infor: infor
+        })
     }
 
     reset(){
         this.setState({
-            cid:'',       //公司编号
+            companyName:'',       //公司名称
             urgent: '',    //加急
             material: '',  //材料
         },()=>{
@@ -188,9 +205,9 @@ class SoftwareConfigure extends Component{
             <div className="user-content" >
                 <div className="content-title">
                     <div className="user-search" style={{display:'flex',flexFlow:'row'}}>
-                        <Input placeholder="公司编号" style={{width:'150px',marginRight:'10px',marginBottom:'10px',marginLeft:10}}
-                               value={this.state.cid}
-                               onChange={(e) => { this.setState({ cid: e.target.value }); }} />
+                        <Input placeholder="公司名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px',marginLeft:10}}
+                               value={this.state.companyName}
+                               onChange={(e) => { this.setState({ companyName: e.target.value }); }} />
                         <div style={{display:'flex',flexFlow:'row nowrap'}}>
                             <div style={{marginLeft:10,marginRight:10}}>材料:</div>
                             <Select style={{ width:'200px',marginRight:'10px' }}
@@ -238,16 +255,19 @@ class SoftwareConfigure extends Component{
                     </div>
                 </div>
                 {this.state.addSoftVisible ? <AddSoftWritingPrice
+                    infor={this.state.infor}
                     visible={this.state.addSoftVisible}
                     onCancel={()=>{
                         this.setState({
-                            addSoftVisible : false
+                            addSoftVisible : false,
+                            infor: {},
                         })
                     }}
                     successFn={()=>{
                         this.loadData();
                         this.setState({
-                            addSoftVisible : false
+                            addSoftVisible : false,
+                            infor: {}
                         })
                     }}/> : <div/>}
             </div>