Browse Source

申请支付

mentoswzq 4 years ago
parent
commit
a2bf3d7d7d

+ 49 - 34
js/component/manageCenter/components/checkProject/applyPaymentModal.js

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {Button, Form, Input, message, Modal, Radio, Spin} from "antd";
+import {Button, Form, Input, message, Modal, Radio, Spin, InputNumber} from "antd";
 import propType from 'prop-types';
 import $ from "jquery";
 
@@ -34,13 +34,13 @@ class ApplyPaymentModal extends Component{
         this.state={
             loading: false,
             paymentStatus: 0,
+            totalPrice: -1,
         }
     }
 
     //申请付款
     handleSubmit(e){
         e.preventDefault();
-        console.log(this.props.previewPayInfor)
         this.props.form.validateFieldsAndScroll((err, values) => {
             if (err) {
                 return;
@@ -174,20 +174,26 @@ class ApplyPaymentModal extends Component{
                                             </Radio.Group>
                                         )}
                                     </Form.Item> : <div/>}
-                            {/*<Form.Item*/}
-                            {/*    {...formItemLayout}*/}
-                            {/*    style={{*/}
-                            {/*        display:'flex'*/}
-                            {/*    }}*/}
-                            {/*    label="单价(万元):"*/}
-                            {/*>*/}
-                            {/*    {getFieldDecorator('unitPrice', {*/}
-                            {/*        rules: [{ required: true, message: '请输入单价!' }],*/}
-                            {/*    })(*/}
-                            {/*        <Input style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>*/}
-                            {/*    )}*/}
-                            {/*</Form.Item>*/}
-                            {/*//TODO 官费暂未确定*/}
+                            {this.props.type !== 2 ? <Form.Item
+                                {...formItemLayout}
+                                style={{
+                                    display:'flex'
+                                }}
+                                label="单价(万元):"
+                            >
+                                {/*可以查看单价	正常  审计 专利买卖
+                                   软著 专利申请 打星号  */}
+                                {
+                                        this.props.projectType === 2 || (this.props.projectType === 1 && this.props.patentType === 0)?
+                                        '***' :
+                                        getFieldDecorator('unitPrice', {
+                                        initialValue:previewPayInfor.unitPrice,
+                                        rules: [{ required: true, message: '请输入单价!' }],
+                                    })(
+                                        <Input disabled={true} style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>
+                                    )
+                                }
+                            </Form.Item> : <div/>}
                             {
                                 this.props.type === 2 ?
                                     <Form.Item
@@ -200,8 +206,9 @@ class ApplyPaymentModal extends Component{
                                         <div>***</div>
                                     </Form.Item> : <div/>
                             }
+                            {/* 0正常 1专利 2软著 3审计 */}
                             {
-                                this.props.projectType !== 0?
+                                this.props.projectType === 1 || this.props.projectType === 2?
                                     <Form.Item
                                         {...formItemLayout}
                                         style={{
@@ -222,7 +229,15 @@ class ApplyPaymentModal extends Component{
                                             initialValue: parseInt(previewPayInfor.quantity),
                                             rules: [{ required: false, message: '请输入數量!' }],
                                         })(
-                                            <Input disabled={previewPayInfor.quantity <= 1} style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
+                                            <InputNumber min={0} onChange={(e)=>{
+                                                //软著 专利申请不需要计算,因为单价未知
+                                                if(!(this.props.projectType === 2 || (this.props.projectType === 1 && this.props.patentType === 0))){
+                                                    let num = previewPayInfor.unitPrice * e;
+                                                    this.setState({
+                                                        totalPrice: num
+                                                    })
+                                                }
+                                            }} disabled={previewPayInfor.quantity <= 1 || this.props.projectType === 3} style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
                                         )}
                                     </Form.Item>
                             }
@@ -233,15 +248,29 @@ class ApplyPaymentModal extends Component{
                                 }}
                                 label="总价(万元):"
                             >
-                                <div>{previewPayInfor.totalAmount}</div>
+                                <div>{this.state.totalPrice > -1 ? this.state.totalPrice : previewPayInfor.totalAmount}</div>
                                 {/*{getFieldDecorator('totalPrice', {*/}
                                 {/*    rules: [{ required: false, message: '请输入总价!' }],*/}
                                 {/*})(*/}
                                 {/*    <Input disabled={true} style={{ width: '200px' }} placeholder="请输入总价" type={'number'}/>*/}
                                 {/*)}*/}
                             </Form.Item>
+                            {/*<Form.Item*/}
+                            {/*    {...formItemLayout}*/}
+                            {/*    style={{*/}
+                            {/*        display:'flex'*/}
+                            {/*    }}*/}
+                            {/*    label="已付(万元):"*/}
+                            {/*>*/}
+                            {/*    {getFieldDecorator('totalPrice', {*/}
+                            {/*        initialValue: previewPayInfor.partyAmount ? parseFloat(previewPayInfor.partyAmount) : 0,*/}
+                            {/*        rules: [{ required: false, message: '请输入已付金额!' }],*/}
+                            {/*    })(*/}
+                            {/*        <Input disabled={true} style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>*/}
+                            {/*    )}*/}
+                            {/*</Form.Item>*/}
                             {
-                                this.props.projectType === 1 && this.props.type === 2?
+                                this.props.projectType === 1 || this.props.projectType === 2 || this.props.type === 2?
                                     <Form.Item
                                         {...formItemLayout}
                                         style={{
@@ -256,20 +285,6 @@ class ApplyPaymentModal extends Component{
                                             <Input disabled={previewPayInfor.quantity <= 1 || this.state.paymentStatus !== 0} style={{ width: '200px' }} placeholder="请输入本次申请支付数量" type={'number'}/>
                                         )}
                                     </Form.Item> : <div/>}
-                            {/*<Form.Item*/}
-                            {/*    {...formItemLayout}*/}
-                            {/*    style={{*/}
-                            {/*        display:'flex'*/}
-                            {/*    }}*/}
-                            {/*    label="已付(万元):"*/}
-                            {/*>*/}
-                            {/*    {getFieldDecorator('totalPrice', {*/}
-                            {/*        initialValue: previewPayInfor.partyAmount ? parseFloat(previewPayInfor.partyAmount) : 0,*/}
-                            {/*        rules: [{ required: false, message: '请输入已付金额!' }],*/}
-                            {/*    })(*/}
-                            {/*        <Input disabled={true} style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>*/}
-                            {/*    )}*/}
-                            {/*</Form.Item>*/}
                             <Form.Item
                                 {...formItemLayout}
                                 style={{

+ 5 - 3
js/component/manageCenter/components/checkProject/index.jsx

@@ -454,7 +454,7 @@ class CheckProject extends Component {
                       }}>
                         申请付款
                       </Button>
-                      {record.officialCost == 1? <Button
+                      {record.officialCost === 1? <Button
                           type="primary"
                           style={{
                             marginLeft: '10px',
@@ -856,10 +856,10 @@ class CheckProject extends Component {
         {
           this.props.projectType === 1?
               <div>
-                <div style={{paddingBottom:'20px',paddingTop:'20px'}}>
+                <div style={{padding:'20px 0px 20px 20px',}}>
                   专利类型:<span style={{marginLeft:'15px'}}>{this.props.patentType === 0 ? '专利申请/变更/转让' : '专利买卖'}</span>
                 </div>
-                <div style={{paddingBottom:'20px'}}>
+                <div style={{paddingBottom:'20px',paddingLeft:'20px'}}>
                   专利名称:<span style={{marginLeft:'15px'}}>
                   {
                     this.props.patentNameType === 0 ? '实用新型专利' :
@@ -1127,6 +1127,8 @@ class CheckProject extends Component {
           {this.state.payRecordVisible ? <PayRecord
                 {...this.props}
                 tid={this.props.tid}
+                projectType={this.props.projectType}
+                patentType={this.props.patentType}
                 payId={this.state.orderPaymentsId}
                 visible={this.state.payRecordVisible}
                 isAuditPayment={this.props.isAuditPayment}

+ 24 - 12
js/component/manageCenter/components/checkProject/payRecord.js

@@ -1,4 +1,4 @@
-//nodeUnitPrice 即是单价也可是官费
+//initialUnitPrice 即是单价也可是官费
 import React,{Component} from 'react';
 import {Button, DatePicker, Form, Input, message, Modal, Spin} from "antd";
 import $ from "jquery/src/ajax";
@@ -146,6 +146,7 @@ class PayRecord extends Component{
         e.preventDefault();
         this.props.form.validateFieldsAndScroll((err, values) => {
             if (err) {
+                console.log(err)
                 return;
             }
             const { paymentDetails } = this.state;
@@ -381,7 +382,7 @@ class PayRecord extends Component{
                 <Spin spinning={this.state.loading}>
                     <div>
                         {/*0第三方 1催款 2官费*/}
-                        <div>{paymentDetails.chooseType === 2 ? '申请支付外包费用' : '申请支付官费'}</div>
+                        <div>{paymentDetails.chooseType === 2 ? '申请支付官费' : '申请支付外包费用'}</div>
                         <Form
                             {...layout}
                             name="basic"
@@ -407,9 +408,18 @@ class PayRecord extends Component{
                                 style={{
                                     display:'flex'
                                 }}
-                                label={paymentDetails.chooseType === 2 ? "官费(万元):":"单价(万元):"}
+                                label={'单价(万元):'}
                             >
-                                <div>{paymentDetails.nodeUnitPrice}</div>
+                                <div>
+                                    {/* projectType 0正常 1专利 2软著 3审计*/}
+                                    {/* isAuditPayment 是否为财务*/}
+                                    {/* chooseType 0第三方 1催款 2官费*/}
+                                    {
+                                        (paymentDetails.chooseType === 2 || this.props.projectType === 2 || (this.props.projectType === 3 && this.props.patentType === 0) ) && !this.props.isAuditPayment?
+                                        '***':
+                                        paymentDetails.initialUnitPrice
+                                    }
+                                </div>
                             </Form.Item>
                             <Form.Item
                                 {...formItemLayout}
@@ -432,20 +442,22 @@ class PayRecord extends Component{
                                 }}
                                 label="总价(万元):"
                             >
-                                <div>{paymentDetails.nodeTotalAmount}</div>
+                                <div>{paymentDetails.initialTotalAmount}</div>
                             </Form.Item>
-                            <Form.Item
+                            {/*官费不显示已付*/}
+                            {paymentDetails.chooseType !== 2 ? <Form.Item
                                 {...formItemLayout}
                                 style={{
                                     display:'flex'
                                 }}
                                 label="已付(万元):"
                             >
-                                <div>{paymentDetails.nodePartyAmount}</div>
-                            </Form.Item>
+                                <div>{paymentDetails.initialPaymentAmount}</div>
+                            </Form.Item> : <div/>}
                             {/*0第三方 1催款 2官费*/}
+                            {/* projectType 0正常 1专利 2软著 3审计*/}
                             {
-                                paymentDetails.chooseType === 2 ?
+                                paymentDetails.chooseType === 2 || this.props.projectType === 1 || this.props.projectType === 2 ?
                                     <Form.Item
                                         {...formItemLayout}
                                         style={{
@@ -453,8 +465,8 @@ class PayRecord extends Component{
                                         }}
                                         label="本次申请支付数量:"
                                     >
-                                        {getFieldDecorator('nodeQuantity', {
-                                            initialValue: paymentDetails.nodeQuantity,
+                                        {getFieldDecorator('initialQuantity', {
+                                            initialValue: paymentDetails.initialQuantity,
                                             rules: [{ required: true, message: '请输入本次申请支付数量!' }],
                                         })(
                                             <Input
@@ -566,7 +578,7 @@ class PayRecord extends Component{
                             {this.props.isAuditPayment && paymentDetails.status === 1 ? <Button style={{marginLeft:'20px'}} type="primary" onClick={(e)=>{
                                 this.handleSubmit(e,3);
                             }}>
-                                确定提交
+                                完成支付
                             </Button> : <div/>}
                         </Form>
                     </div>

+ 43 - 4
js/component/manageCenter/order/orderNew/costAuditList/detailsModal/index.js

@@ -14,8 +14,10 @@ class DetailsModal extends Component{
             loading: false,
             activeKey:'1',
             paySubject: [],
+            orderDtails: {},
         }
         this.visitCancel = this.visitCancel.bind(this);
+        this.getOrderOutsourceDtails = this.getOrderOutsourceDtails.bind(this);
     }
 
     componentDidMount() {
@@ -203,6 +205,38 @@ class DetailsModal extends Component{
         )
     }
 
+    // 外包详情
+    getOrderOutsourceDtails(data) {
+        this.setState({
+            loading: true,
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/outsourceOrg/orderOutsourceDtails",
+            data: {
+                tid: data.tid,
+                orderNo: data.orderNo,
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else{
+                    this.setState({
+                        orderDtails: data.data
+                    });
+                }
+            }.bind(this),
+        }).always(
+            function () {
+                this.setState({
+                    loading: false,
+                });
+            }.bind(this)
+        );
+    }
+
     render() {
         return(
             <Modal
@@ -220,23 +254,28 @@ class DetailsModal extends Component{
                         this.setState({
                             activeKey: e
                         })
+                        if(e === '2'){
+                            this.getOrderOutsourceDtails({
+                                tid: this.props.tid,
+                                orderNo: this.props.orderNo,
+                            })
+                        }
                     }}
                 >
                     <TabPane tab="项目概况" key="1">
                         <ProjectOverview projectStatus={this.props.projectStatus} tid={this.props.tid}/>
                     </TabPane>
                     <TabPane tab="外包/供应商信息" key="2">
-                        {this.props.projectType}
                         <CheckProject
                             {...this.props}
                             tid={this.props.tid}
                             isAuditPayment={true}
                             status={this.state.refundStatus}
-                            patentNameType={this.props.patentNameType}
+                            patentNameType={this.state.orderDtails.patentNameType}
+                            patentName={this.state.orderDtails.patentName}
+                            patentType={this.state.orderDtails.patentType}
                             projectType={this.props.projectType}
                             projectStatus={this.props.projectStatus}
-                            patentName={this.props.patentName}
-                            patentType={this.props.patentType}
                             thirdInfoList={this.state.thirdInfoList}
                             dataSource={this.state.payNodeList}
                             outsourceRemarks={this.state.outsourceRemarks}

+ 2 - 6
js/component/manageCenter/order/orderNew/costAuditList/index.js

@@ -195,7 +195,6 @@ class CostAuditList extends Component{
     }
 
     tableRowClick(record){
-        console.log(record);
         this.setState({
             visible: true,
             selectInfor: record,
@@ -229,13 +228,10 @@ class CostAuditList extends Component{
               {
                   this.state.visible ?
                       <DetailsModal
-                          patentNameType={this.state.selectInfor.patentNameType}
-                          projectType={this.state.selectInfor.projectType}
-                          projectStatus={this.state.selectInfor.projectStatus}
-                          patentName={this.state.selectInfor.patentName}
-                          patentType={this.state.selectInfor.patentType}
                           tid={this.state.selectInfor.tid}
                           orderNo={this.state.selectInfor.orderNo}
+                          projectType={this.state.selectInfor.projectType}
+                          projectStatus={this.state.selectInfor.projectStatus}
                           visible={this.state.visible}
                           visitCancel={()=>{
                               this.setState({

+ 19 - 28
js/component/manageCenter/project/task/myTask.jsx

@@ -2138,16 +2138,12 @@ const Task = React.createClass({
   },
   // 项目发起外包
   sureOut() {
-    console.log({
-      patentType:this.state.patentType,
-      patentNameType:this.state.patentNameType,
-      patentName:this.state.patentName,
-    })
     if (this.state.startType !== 0 && this.state.startType !== 1) {
       message.warning('请选择类型')
       return
     }
-    if (this.state.refundStatus === 1) {
+    //0正常 1专利 2软著 3审计
+    if (this.state.projectType === 1) {
       //专利
       if (this.state.patentType === -1) {
         message.warning('请选择专利类型')
@@ -2168,30 +2164,20 @@ const Task = React.createClass({
       message.warning('备注不能为空')
       return
     }
-    if (this.state.pictureUrl.length === 0) {
+    console.log(this.state.pictureUrl)
+    if (!this.state.pictureUrl && !Array.isArray(this.state.pictureUrl)) {
+      message.warning('合同扫描件不能为空')
+      return
+    }
+
+    if(this.state.pictureUrl.length === 0){
       message.warning('合同扫描件不能为空')
       return
     }
+
     this.setState({
       loading: true,
     })
-    // setTimeout(() => {
-    //   this.setState({
-    //     loading: true,
-    //   })
-    //   /* this.setState(
-    //     {
-    //       ContactsListsNew: this.state.ContactsListsNew.map((item) => {
-    //         if (item.title != '操作') {
-    //           this.state.ContactsListsNew.push(item)
-    //         }
-    //       }),
-    //     },
-    //     () => {
-    //       console.log('this.state.contactListNew', this.state.contactListNew)
-    //     }
-    //   ) */
-    // }, 3000)
 
     let data = {
       tid: this.state.id,
@@ -2203,16 +2189,18 @@ const Task = React.createClass({
       pictureUrl: this.getUrl(this.state.pictureUrl).length
           ? this.getUrl(this.state.pictureUrl)
           : '',
-      patentNameType:this.state.patentNameType,
-      patentName:this.state.patentName,
       outsourceRemarks: this.state.outsourceRemarks,
       unitNumber: this.state.unitNumber,
       unitPrice: this.state.unitPrice,
       id: this.state.refundStatus == 2 ? this.state.mid : undefined,
     }
 
-    if (this.state.refundStatus === 1) {
+    if (this.state.projectType === 1) {
       data.patentType = this.state.patentType;
+      data.patentNameType = this.state.patentNameType;
+      if (this.state.patentNameType == 3) {
+        data.patentName = this.state.patentName;
+      }
     }
 
     $.ajax({
@@ -2563,7 +2551,7 @@ const Task = React.createClass({
           let arr = data.data || []
           let allTotalAmount = 0
           let type = 0;
-          let type1 = 0;
+          let patentNameType = 0;
           for (let i = 0; i < arr.length; i++) {
             thisData = arr[i]
             allTotalAmount =
@@ -2587,8 +2575,10 @@ const Task = React.createClass({
               costReduction: thisData.costReduction,//费减
               officialCost: thisData.officialCost,//官费
               type: thisData.type,   //0其他 1专利申请 2专利买卖
+              patentType: thisData.type,   //专利名称类型   0实用新型 1发明专利 2外观专利 3 其他
             })
             type=thisData.type
+            patentNameType= thisData.patentNameType
           }
           if (!allTotalAmount) {
             allTotalAmount = 0
@@ -2605,6 +2595,7 @@ const Task = React.createClass({
           if(type === 1 || type === 2){
             this.setState({
               patentType: type === 1 ? 0 : type === 2 ? 1 : -1,    //0其他 1专利申请 2专利买卖
+              patentNameType: patentNameType,                         //0实用新型 1发明专利 2外观专利 3 其他
             })
           }
 

+ 17 - 18
js/component/manageCenter/project/task/myTaskOutsource.jsx

@@ -5,6 +5,7 @@ import Picture from "@/manageCenter/publicComponent/picture";
 import ResolutionDetail from "@/resolutionDetail";
 import "@/manageCenter/financialManage/distribute/public.less";
 import "@/manageCenter/financialManage/distribute/shouKuan.less";
+import {cuiJieDian } from '@/dataDic.js'
 import OrderDetail from "../../order/orderNew/changeComponent/orderDetail";
 import {
   Button,
@@ -753,6 +754,8 @@ const MyTaskOutsource = React.createClass({
     this.thirdTable(record.id)
     //获取支付节点信息表格
     this.payNodeTable(record.id)
+    // 获取Csort
+    this.getCsortData(localStorage.getItem('cSort'))
   },
   //点击修改项目详情
   tijiaoOk() {
@@ -1296,6 +1299,8 @@ const MyTaskOutsource = React.createClass({
     this.loadCompany();
     if (e == 2) {
       this.waiDetail()
+      this.thirdTable(this.state.tid);
+      this.payNodeTable(this.state.tid)
     }
     if (e == 3) {
       this.orderDetailData(this.state.orderNo);
@@ -1767,6 +1772,16 @@ const MyTaskOutsource = React.createClass({
       }.bind(this),
     });
   },
+  // 获取csort下的数据
+  getCsortData(cSort) {
+    cuiJieDian.map((item) => {
+      if (item.value == cSort) {
+        this.setState({
+          paySubject: item.children,
+        })
+      }
+    })
+  },
   jiedianNew(orderNos) {
     $.ajax({
       method: "get",
@@ -1854,28 +1869,12 @@ const MyTaskOutsource = React.createClass({
             allTotalAmount =
                 (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000
             companyNameArr.push(thisData.companyName)
-            theArr.push({
-              key: i,
-              id: thisData.id, //节点Id
-              tid: thisData.tid,
-              companyName: thisData.companyName, //供应商名称
-              unitPrice: thisData.unitPrice, //单价
-              quantity: thisData.quantity, //数量
-              totalAmount: thisData.totalAmount, //总价
-              material: thisData.material, //材料 0无 1有
-              urgent: thisData.urgent, //	0无加急(系统默认)1加急3天 2加急4天 3加急5-10天 4加急11-15天 5加急16-20天 6加急21-25天 7加急26-30天
-              audit: thisData.audit, //0无审计 1年审 2专审
-              assets: thisData.assets, //资产
-              income: thisData.income, //收入
-              remarks: thisData.remarks, //备注
-              cid: thisData.cid, //机构id
-            })
+            thisData.key = i;
+            theArr.push(thisData);
           }
           if (!allTotalAmount) {
             allTotalAmount = 0
           }
-          console.log(theArr)
-          console.log(companyNameArr)
 
           this.setState({
             tid: id,

+ 2 - 1
js/component/manageCenter/project/task/newSupplier.js

@@ -304,7 +304,8 @@ class NewSupplier extends Component{
                                     <span className="mandatory">*</span>
                                 </Form.Item>
                             </div>
-                            {this.props.projectType !== 2 ?<div className="clearfix">
+                            {/*专利 的专利申请 和 软著没有总价*/}
+                            {this.props.projectType !== 2 && this.props.patentType !==0 ?<div className="clearfix">
                                 <Form.Item {...formItemLayout} label="总价(万元)">
                                     <span>{this.state.thirdQuantity * this.state.thirdUnitPrice}</span>
                                 </Form.Item>