瀏覽代碼

第三方信息列表 付款节点

mentoswzq 4 年之前
父節點
當前提交
3419029e72

+ 47 - 22
js/component/manageCenter/components/checkProject/applyPaymentModal.js

@@ -50,11 +50,18 @@ class ApplyPaymentModal extends Component{
             values.tid = this.props.tid;
             if(this.props.nodeId){                      //催款
                 values.nodeId = this.props.nodeId;
-                values.chooseType = 1;                  //支付选择 0第三方 1催款
+                values.chooseType = 1;                          //支付选择 0第三方 1催款
+                values.tcpid = this.props.previewPayInfor.cid;  //第三方机构id
             }else{
-                values.chooseType = 0                   //支付选择 0第三方 1催款
+                values.chooseType = 0                           //支付选择 0第三方 1催款
+                values.tcpid = this.props.previewPayInfor.id;   //第三方机构id
             }
-            values.paymentType = 0;                 //支付类型 0第三方 1官费(用来做判断发起区别)
+            if(this.props.type === 2){
+                values.paymentType = 1;                 //支付类型 0第三方 1官费(用来做判断发起区别)
+            }else{
+                values.paymentType = 0;                 //支付类型 0第三方 1官费(用来做判断发起区别)
+            }
+            values.companyName = values.companyName.split('-')[0];
             $.ajax({
                 method: 'POST',
                 dataType: 'json',
@@ -95,7 +102,11 @@ class ApplyPaymentModal extends Component{
             >
                 <Spin spinning={this.state.loading}>
                     <div>
-                        <div>支付供应商费用</div>
+                        <div>
+                            {
+                                this.props.type === 2 ? "支付供应商官费" : "支付供应商费用"
+                            }
+                        </div>
                         <Form
                             {...layout}
                             name="basic"
@@ -139,12 +150,25 @@ class ApplyPaymentModal extends Component{
                             {/*        <Input style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>*/}
                             {/*    )}*/}
                             {/*</Form.Item>*/}
+                            {/*//TODO 官费暂未确定*/}
+                            {
+                                this.props.type === 2 ?
+                                    <Form.Item
+                                        {...formItemLayout}
+                                        style={{
+                                            display:'flex'
+                                        }}
+                                        label="官费(万元):"
+                                    >
+                                        <div>***</div>
+                                    </Form.Item> : <div/>
+                            }
                             <Form.Item
                                 {...formItemLayout}
                                 style={{
                                     display:'flex'
                                 }}
-                                label="数量:"
+                                label="数量(个):"
                             >
                                 {getFieldDecorator('quantity', {
                                     initialValue: parseInt(previewPayInfor.quantity),
@@ -153,17 +177,32 @@ class ApplyPaymentModal extends Component{
                                     <Input disabled={previewPayInfor.quantity <= 1} style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
                                 )}
                             </Form.Item>
+                            <Form.Item
+                                {...formItemLayout}
+                                style={{
+                                    display:'flex'
+                                }}
+                                label="总价(万元):"
+                            >
+                                <div>{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="总价(万元):"*/}
+                            {/*    label="已付(万元):"*/}
                             {/*>*/}
                             {/*    {getFieldDecorator('totalPrice', {*/}
-                            {/*        rules: [{ required: false, message: '请输入总价!' }],*/}
+                            {/*        initialValue: previewPayInfor.partyAmount ? parseFloat(previewPayInfor.partyAmount) : 0,*/}
+                            {/*        rules: [{ required: false, message: '请输入已付金额!' }],*/}
                             {/*    })(*/}
-                            {/*        <Input style={{ width: '200px' }} placeholder="请输入总价" type={'number'}/>*/}
+                            {/*        <Input disabled={true} style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>*/}
                             {/*    )}*/}
                             {/*</Form.Item>*/}
                             <Form.Item
@@ -171,20 +210,6 @@ class ApplyPaymentModal extends Component{
                                 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={{
-                                    display:'flex'
-                                }}
                                 label="本次申请支付金额(万元):"
                             >
                                 {getFieldDecorator('applicationAmount', {

+ 117 - 386
js/component/manageCenter/components/checkProject/index.jsx

@@ -28,121 +28,30 @@ class CheckProject extends Component {
       payRecordVisible: false,
       orderPaymentsId: 0,
       previewPayVisible: false,
+      type: 1,//1 申请付款 2 申请付官费
       previewPayInfor: {},        //点击申请付款的第三方信息或者支付节点信息
       nodeId: 0,
       // 专利
-      ContactsListsNew: [
-        {
-          title: '供应商名称',
-          dataIndex: 'companyName',
-          key: 'companyName',
-          render: (text, record, index) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '单价(万元)',
-          dataIndex: 'unitPrice',
-          key: 'unitPrice',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '数量',
-          dataIndex: 'quantity',
-          key: 'quantity',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '总价(万元)',
-          dataIndex: 'totalAmount',
-          key: 'totalAmount',
-          render: (text, record) => {
-            return <span>{text}</span>
-          },
-        },
-        {
-          title: '已付(万元)',
-          dataIndex: 'partyAmount',
-          key: 'partyAmount',
-          render: (text, record) => {
-              return <span>{text}</span>
-          },
-        },
-        {
-          title: '材料',
-          dataIndex: 'material',
-          key: 'material',
-          render: (text, record) => {
-            return getMaterialStatus(text)
-          },
-        },
-        {
-          title: '加急',
-          dataIndex: 'urgent',
-          key: 'urgent',
-          render: (text, record) => {
-            return getUrgentStatus(text)
-          },
-        },
-        {
-          title: '操作',
-          dataIndex: 'action',
-          key: 'action',
-          render: (ext, record, index) => {
-            return (
-              <div>
-                {/*外包审核通过后,咨询师/咨询经理可申请付款*/}
-                {/*存在支付节点时不显示第三方的申请付款*/}
-                {/*0-待审核 ,1-审核通过,2-审核拒绝 true [NULL]*/}
-                {
-                    <Button disabled={
-                      !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)
-                    } type="primary" onClick={() => {
-                      this.setState({
-                        previewPayVisible: true,
-                        previewPayInfor: record,
-                      })
-                    }}>
-                      申请付款
-                    </Button>
-                }
-                <Popconfirm
-                    title="是否删除?"
-                    onConfirm={() => {
-                      this.confirmDeletNew(record)
-                    }}
-                    okText="删除"
-                    cancelText="不删除"
-                >
-                  <Button
-                      onClick={(e) => {
-                        e.stopPropagation()
-                      }}
-                      style={{
-                        marginLeft: '10px',
-                        color: '#ffffff',
-                        background: '#f00',
-                        border: 'none',
-                      }}
-                  >
-                    删除
-                  </Button>
-                </Popconfirm>
-              </div>
-            )
-          },
-        },
-      ],
+      ContactsListsNew: [],
+      //付款节点表头
+      PayNodeTableColunms: [],
+      outsourceLogs: [],//审核日志
+      selectOrderPayments: [],//支付列表
+    }
+  }
+
+  componentDidMount() {
+    if(this.props.tid){
+      setTimeout(()=>{
+        this.getSelectOutsourceLog();
+        this.getSelectOrderPayment();
+        this.projectTypeTabContent(this.props.projectType);
+      },500)
+    }
+  }
+
+  projectTypeTabContent(projectType) {
+    this.setState({
       //付款节点表头
       PayNodeTableColunms: [
         {
@@ -170,9 +79,7 @@ class CheckProject extends Component {
           dataIndex: 'partyTimes',
           key: 'partyTimes',
           render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
+            return <span>{text ? text : '/'}</span>
           },
         },
         {
@@ -186,15 +93,15 @@ class CheckProject extends Component {
           },
         },
         {
-          title: '总价(万元)',
+          title: '总价',
           dataIndex: 'totalAmount',
           key: 'totalAmount',
           render: (text, record) => {
-              return <span>{text}</span>
+            return <span>{text}</span>
           },
         },
         {
-          title: '已付(万元)',
+          title: '已付',
           dataIndex: 'partyAmount',
           key: 'partyAmount',
           render: (text, record) => {
@@ -205,50 +112,55 @@ class CheckProject extends Component {
         },
         {
           title: '操作',
-          dataIndex: 'action',
-          key: 'action',
-          render: (text, record) => {
+          dataIndex: 'dels',
+          key: 'dels',
+          render: (text, record, index) => {
             return (
                 <div>
                   {/*外包审核通过后,咨询师/咨询经理可申请付款*/}
+                  {/*存在支付节点时不显示第三方的申请付款*/}
                   {/*0-待审核 ,1-审核通过,2-审核拒绝 true [NULL]*/}
+                  {/*this.props.startType   0外包  1供应商(不需要审核)*/}
+                  <Button disabled={
+                    !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1))
+                  } type="primary" onClick={() => {
+                    this.setState({
+                      previewPayVisible: true,
+                      previewPayInfor: record,
+                    })
+                  }}>
+                    申请付款
+                  </Button>
+                  {this.props.status === 2 ? <Popconfirm
+                      title="是否删除?"
+                      onConfirm={() => {
+                        this.payNodeConfirmDeletNew(record)
+                      }}
+                      okText="删除"
+                      cancelText="不删除"
+                  >
                     <Button
-                        disabled={
-                          !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1))
-                        }
-                        type="primary"
-                        onClick={() => {
-                          console.log(record)
-                          this.setState({
-                            previewPayVisible: true,
-                            nodeId: record.id,           //付款节点id
-                            previewPayInfor: record,
-                          })
-                    }}>
-                      申请付款
+                        disabled={this.props.status !== 2}
+                        onClick={(e) => {
+                          e.stopPropagation()
+                        }}
+                        style={{
+                          marginLeft: '10px',
+                          color: '#ffffff',
+                          background: '#f00',
+                          border: 'none',
+                        }}
+                    >
+                      删除
                     </Button>
+                  </Popconfirm> : <div/>}
                 </div>
             )
           },
         },
       ],
-      outsourceLogs: [],//审核日志
-      selectOrderPayments: [],//支付列表
-    }
-  }
-
-  componentDidMount() {
-    if(this.props.tid){
-      setTimeout(()=>{
-        this.getSelectOutsourceLog();
-        this.getSelectOrderPayment();
-        this.projectTypeTabContent(this.props.projectType);
-      },500)
-    }
-  }
-
-  projectTypeTabContent(projectType) {
-    if(projectType === 0){       //0正常 1专利 2软著 3审计
+    })
+    if(projectType === 0 || !projectType){       //0正常 1专利 2软著 3审计
       this.setState({
         ContactsListsNew: [
           {
@@ -306,19 +218,18 @@ class CheckProject extends Component {
                     {/*外包审核通过后,咨询师/咨询经理可申请付款*/}
                     {/*存在支付节点时不显示第三方的申请付款*/}
                     {/*0-待审核 ,1-审核通过,2-审核拒绝 true [NULL]*/}
-                    {
-                      <Button disabled={
-                        !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)
-                      } type="primary" onClick={() => {
-                        this.setState({
-                          previewPayVisible: true,
-                          previewPayInfor: record,
-                        })
-                      }}>
-                        申请付款
-                      </Button>
-                    }
-                    <Popconfirm
+                    {/*this.props.startType   0外包  1供应商(不需要审核)*/}
+                    <Button disabled={
+                      !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)
+                    } type="primary" onClick={() => {
+                      this.setState({
+                        previewPayVisible: true,
+                        previewPayInfor: record,
+                      })
+                    }}>
+                      申请付款
+                    </Button>
+                    {this.props.status === 2 ? <Popconfirm
                         title="是否删除?"
                         onConfirm={() => {
                           this.confirmDeletNew(record)
@@ -327,6 +238,7 @@ class CheckProject extends Component {
                         cancelText="不删除"
                     >
                       <Button
+                          disabled={this.props.status !== 2}
                           onClick={(e) => {
                             e.stopPropagation()
                           }}
@@ -339,99 +251,7 @@ class CheckProject extends Component {
                       >
                         删除
                       </Button>
-                    </Popconfirm>
-                  </div>
-              )
-            },
-          },
-        ],
-        //付款节点表头
-        PayNodeTableColunms: [
-          {
-            title: '供应商名称',
-            dataIndex: 'companyName',
-            key: 'companyName',
-            render: (text, record, index) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款科目',
-            dataIndex: 'dunType',
-            key: 'dunType',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款时间',
-            dataIndex: 'partyTimes',
-            key: 'partyTimes',
-            render: (text, record) => {
-              return <span>{text ? text : '/'}</span>
-            },
-          },
-          {
-            title: '数量',
-            dataIndex: 'quantity',
-            key: 'quantity',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '总价',
-            dataIndex: 'totalAmount',
-            key: 'totalAmount',
-            render: (text, record) => {
-              return <span>{text}</span>
-            },
-          },
-          {
-            title: '已付',
-            dataIndex: 'partyAmount',
-            key: 'partyAmount',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '操作',
-            dataIndex: 'dels',
-            key: 'dels',
-            render: (text, record, index) => {
-              return (
-                  <div>
-                    <Popconfirm
-                        title="是否删除?"
-                        onConfirm={() => {
-                          this.payNodeConfirmDeletNew(record)
-                        }}
-                        okText="删除"
-                        cancelText="不删除"
-                    >
-                      <Button
-                          onClick={(e) => {
-                            e.stopPropagation()
-                          }}
-                          style={{
-                            marginRight: '10px',
-                            color: '#ffffff',
-                            background: '#f00',
-                            border: 'none',
-                          }}
-                      >
-                        删除
-                      </Button>
-                    </Popconfirm>
+                    </Popconfirm> : <div/>}
                   </div>
               )
             },
@@ -519,7 +339,7 @@ class CheckProject extends Component {
                         申请付款
                       </Button>
                     }
-                    <Popconfirm
+                    {this.props.status === 2 ? <Popconfirm
                         title="是否删除?"
                         onConfirm={() => {
                           this.confirmDeletNew(record)
@@ -528,6 +348,7 @@ class CheckProject extends Component {
                         cancelText="不删除"
                     >
                       <Button
+                          disabled={this.props.status !== 2}
                           onClick={(e) => {
                             e.stopPropagation()
                           }}
@@ -540,99 +361,7 @@ class CheckProject extends Component {
                       >
                         删除
                       </Button>
-                    </Popconfirm>
-                  </div>
-              )
-            },
-          },
-        ],
-        //付款节点表头
-        PayNodeTableColunms: [
-          {
-            title: '供应商名称',
-            dataIndex: 'companyName',
-            key: 'companyName',
-            render: (text, record, index) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款科目',
-            dataIndex: 'dunType',
-            key: 'dunType',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款时间',
-            dataIndex: 'partyTimes',
-            key: 'partyTimes',
-            render: (text, record) => {
-              return <span>{text ? text : '/'}</span>
-            },
-          },
-          {
-            title: '数量',
-            dataIndex: 'quantity',
-            key: 'quantity',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '总价',
-            dataIndex: 'totalAmount',
-            key: 'totalAmount',
-            render: (text, record) => {
-              return <span>***</span>
-            },
-          },
-          {
-            title: '已付',
-            dataIndex: 'partyAmount',
-            key: 'partyAmount',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '操作',
-            dataIndex: 'dels',
-            key: 'dels',
-            render: (text, record, index) => {
-              return (
-                  <div>
-                    <Popconfirm
-                        title="是否删除?"
-                        onConfirm={() => {
-                          this.payNodeConfirmDeletNew(record)
-                        }}
-                        okText="删除"
-                        cancelText="不删除"
-                    >
-                      <Button
-                          onClick={(e) => {
-                            e.stopPropagation()
-                          }}
-                          style={{
-                            marginRight: '10px',
-                            color: '#ffffff',
-                            background: '#f00',
-                            border: 'none',
-                          }}
-                      >
-                        删除
-                      </Button>
-                    </Popconfirm>
+                    </Popconfirm> : <div/>}
                   </div>
               )
             },
@@ -714,35 +443,32 @@ class CheckProject extends Component {
                       {/*外包审核通过后,咨询师/咨询经理可申请付款*/}
                       {/*存在支付节点时不显示第三方的申请付款*/}
                       {/*0-待审核 ,1-审核通过,2-审核拒绝 true [NULL]*/}
-                      {
-                        <Button disabled={
-                          !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)
-                        } type="primary" onClick={() => {
-                          this.setState({
-                            previewPayVisible: true,
-                            previewPayInfor: record,
-                          })
-                        }}>
-                          申请付款
-                        </Button>
-                      }
-                      {
-                        <Button
-                            type="primary"
-                            style={{
-                              marginLeft: '10px',
-                            }}
-                            disabled={!(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)}
-                            onClick={() => {
-                              this.setState({
-                                previewPayVisible: true,
-                                previewPayInfor: record,
-                              })
-                            }}>
-                          付官费
-                        </Button>
-                      }
-                      <Popconfirm
+                      <Button disabled={
+                        !(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1) && this.props.dataSource.length === 0)
+                      } type="primary" onClick={() => {
+                        this.setState({
+                          previewPayVisible: true,
+                          previewPayInfor: record,
+                        })
+                      }}>
+                        申请付款
+                      </Button>
+                      <Button
+                          type="primary"
+                          style={{
+                            marginLeft: '10px',
+                          }}
+                          disabled={!(this.props.isPreviewPay && (this.props.status === 1 || parseInt(this.props.startType) === 1))}
+                          onClick={() => {
+                            this.setState({
+                              previewPayVisible: true,
+                              previewPayInfor: record,
+                              type: 2,
+                            })
+                          }}>
+                        付官费
+                      </Button>
+                      {this.props.status === 2 ? <Popconfirm
                           title="是否删除?"
                           onConfirm={() => {
                             this.confirmDeletNew(record)
@@ -751,6 +477,7 @@ class CheckProject extends Component {
                           cancelText="不删除"
                       >
                         <Button
+                            disabled={this.props.status !== 2}
                             onClick={(e) => {
                               e.stopPropagation()
                             }}
@@ -763,12 +490,12 @@ class CheckProject extends Component {
                         >
                           删除
                         </Button>
-                      </Popconfirm>
+                      </Popconfirm> : <div/>}
                     </div>
                 )
               },
             },
-          ]
+          ],
         })
       }else{
         this.setState({
@@ -840,7 +567,7 @@ class CheckProject extends Component {
                           申请付款
                         </Button>
                       }
-                      <Popconfirm
+                      {this.props.status === 2 ? <Popconfirm
                           title="是否删除?"
                           onConfirm={() => {
                             this.confirmDeletNew(record)
@@ -849,6 +576,7 @@ class CheckProject extends Component {
                           cancelText="不删除"
                       >
                         <Button
+                            disabled={this.props.status !== 2}
                             onClick={(e) => {
                               e.stopPropagation()
                             }}
@@ -861,7 +589,7 @@ class CheckProject extends Component {
                         >
                           删除
                         </Button>
-                      </Popconfirm>
+                      </Popconfirm> : <div/>}
                     </div>
                 )
               },
@@ -964,7 +692,7 @@ class CheckProject extends Component {
                         申请付款
                       </Button>
                     }
-                    <Popconfirm
+                    {this.props.status === 2 ? <Popconfirm
                         title="是否删除?"
                         onConfirm={() => {
                           this.confirmDeletNew(record)
@@ -973,6 +701,7 @@ class CheckProject extends Component {
                         cancelText="不删除"
                     >
                       <Button
+                          disabled={this.props.status !== 2}
                           onClick={(e) => {
                             e.stopPropagation()
                           }}
@@ -985,7 +714,7 @@ class CheckProject extends Component {
                       >
                         删除
                       </Button>
-                    </Popconfirm>
+                    </Popconfirm> : <div/>}
                   </div>
               )
             },
@@ -1356,6 +1085,7 @@ class CheckProject extends Component {
         <ApplyPaymentModal
             {...this.props}
             tid={this.props.tid}
+            type={this.state.type}
             nodeId={this.state.nodeId}
             previewPayInfor={this.state.previewPayInfor}
             visible={this.state.previewPayVisible}
@@ -1368,6 +1098,7 @@ class CheckProject extends Component {
                 previewPayVisible: false,
                 nodeId: 0,                  //付款节点id
                 previewPayInfor: {},
+                type: 1
               })
             }}/>
           {/*  支付记录操作弹出  */}

+ 170 - 442
js/component/manageCenter/project/task/myTask.jsx

@@ -187,6 +187,7 @@ const Task = React.createClass({
               contractNo: thisdata.contractNo,
               approval: thisdata.approval, //特批状态
               outsourceStatus: thisdata.outsourceStatus, //外包审核状态
+              outsourceType: thisdata.outsourceType, //外包审核状态
               splitStatus: thisdata.splitStatus, //是否为子项目 2是 1主项目
               splitSuper: thisdata.splitSuper,
               splitId: thisdata.splitId,
@@ -358,18 +359,23 @@ const Task = React.createClass({
           },
         },
         {
-          title: '外包审核',
+          title: '审核状态',
           dataIndex: 'outsourceStatus',
           key: 'outsourceStatus',
-          render: (text) => {
-            if (text == 0) {
-              return <Tag color="#f50">待审核</Tag>
-            } else if (text == 1) {
-              return <Tag color="#87d068">审核通过</Tag>
-            } else if (text == 2) {
-              return <Tag color="#2db7f5">审核驳回</Tag>
-            } else {
-              return '非外包'
+          render: (text,record) => {
+            if(record.outsourceType === 1){
+              return '供应商'
+            }else{
+              if (text === 0) {
+                return <Tag color="#f50">外包待审核</Tag>
+              } else if (text === 1) {
+                return <Tag color="#87d068">外包已通过</Tag>
+              } else if (text === 2) {
+                return <Tag color="#2db7f5">外包被驳回</Tag>
+              } else {
+                return <div style={{textAlign:'center'}}>/</div>
+              }
+              return text
             }
           },
         },
@@ -637,194 +643,9 @@ const Task = React.createClass({
         },
       ],
       // 专利
-      ContactsListsNew: [
-        {
-          title: '供应商名称',
-          dataIndex: 'companyName',
-          key: 'companyName',
-          render: (text, record, index) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '单价(万元)',
-          dataIndex: 'unitPrice',
-          key: 'unitPrice',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '数量',
-          dataIndex: 'quantity',
-          key: 'quantity',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '总价',
-          dataIndex: 'totalAmount',
-          key: 'totalAmount',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '材料',
-          dataIndex: 'material',
-          key: 'material',
-          render: (text, record) => {
-            return getMaterialStatus(text)
-          },
-        },
-        {
-          title: '加急',
-          dataIndex: 'urgent',
-          key: 'urgent',
-          render: (text, record) => {
-            return getUrgentStatus(text)
-          },
-        },
-        {
-          title: '备注',
-          dataIndex: 'remarks',
-          key: 'remarks',
-        },
-        {
-          title: '操作',
-          dataIndex: 'dels',
-          key: 'dels',
-          render: (text, record, index) => {
-            return (
-              <div>
-                <Popconfirm
-                  title="是否删除?"
-                  onConfirm={() => {
-                    this.confirmDeletNew(record)
-                  }}
-                  okText="删除"
-                  cancelText="不删除"
-                >
-                  <Button
-                    onClick={(e) => {
-                      e.stopPropagation()
-                    }}
-                    style={{
-                      marginRight: '10px',
-                      color: '#ffffff',
-                      background: '#f00',
-                      border: 'none',
-                    }}
-                  >
-                    删除
-                  </Button>
-                </Popconfirm>
-              </div>
-            )
-          },
-        },
-      ],
+      ContactsListsNew: [],
       //付款节点表头
-      PayNodeTableColunms: [
-        {
-          title: '供应商名称',
-          dataIndex: 'companyName',
-          key: 'companyName',
-          render: (text, record, index) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '付款科目',
-          dataIndex: 'dunType',
-          key: 'dunType',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '付款时间',
-          dataIndex: 'partyTimes',
-          key: 'partyTimes',
-          render: (text, record) => {
-            return <span>{text ? text : '/'}</span>
-          },
-        },
-        {
-          title: '数量',
-          dataIndex: 'quantity',
-          key: 'quantity',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '总价',
-          dataIndex: 'totalAmount',
-          key: 'totalAmount',
-          render: (text, record) => {
-            return <span>***</span>
-          },
-        },
-        {
-          title: '已付',
-          dataIndex: 'partyAmount',
-          key: 'partyAmount',
-          render: (text, record) => {
-            if (text) {
-              return <span>{text}</span>
-            }
-          },
-        },
-        {
-          title: '操作',
-          dataIndex: 'dels',
-          key: 'dels',
-          render: (text, record, index) => {
-            return (
-              <div>
-                <Popconfirm
-                  title="是否删除?"
-                  onConfirm={() => {
-                    this.payNodeConfirmDeletNew(record)
-                  }}
-                  okText="删除"
-                  cancelText="不删除"
-                >
-                  <Button
-                    onClick={(e) => {
-                      e.stopPropagation()
-                    }}
-                    style={{
-                      marginRight: '10px',
-                      color: '#ffffff',
-                      background: '#f00',
-                      border: 'none',
-                    }}
-                  >
-                    删除
-                  </Button>
-                </Popconfirm>
-              </div>
-            )
-          },
-        },
-      ],
+      PayNodeTableColunms: [],
     }
   },
   /* 分派 */
@@ -852,7 +673,7 @@ const Task = React.createClass({
   },
   //用于判断 第三方信息表格显示
   projectTypeTabContent(projectType) {
-    if(projectType === 0){       //0正常 1专利 2软著 3审计
+    if(projectType === 0 || !projectType){       //0正常 1专利 2软著 3审计
       this.setState({
         ContactsListsNew: [
           {
@@ -949,98 +770,6 @@ const Task = React.createClass({
             },
           },
         ],
-        //付款节点表头
-        PayNodeTableColunms: [
-          {
-            title: '供应商名称',
-            dataIndex: 'companyName',
-            key: 'companyName',
-            render: (text, record, index) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款科目',
-            dataIndex: 'dunType',
-            key: 'dunType',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款时间',
-            dataIndex: 'partyTimes',
-            key: 'partyTimes',
-            render: (text, record) => {
-              return <span>{text ? text : '/'}</span>
-            },
-          },
-          {
-            title: '数量',
-            dataIndex: 'quantity',
-            key: 'quantity',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '总价',
-            dataIndex: 'totalAmount',
-            key: 'totalAmount',
-            render: (text, record) => {
-              return <span>{text}</span>
-            },
-          },
-          {
-            title: '已付',
-            dataIndex: 'partyAmount',
-            key: 'partyAmount',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '操作',
-            dataIndex: 'dels',
-            key: 'dels',
-            render: (text, record, index) => {
-              return (
-                  <div>
-                    <Popconfirm
-                        title="是否删除?"
-                        onConfirm={() => {
-                          this.payNodeConfirmDeletNew(record)
-                        }}
-                        okText="删除"
-                        cancelText="不删除"
-                    >
-                      <Button
-                          onClick={(e) => {
-                            e.stopPropagation()
-                          }}
-                          style={{
-                            marginRight: '10px',
-                            color: '#ffffff',
-                            background: '#f00',
-                            border: 'none',
-                          }}
-                      >
-                        删除
-                      </Button>
-                    </Popconfirm>
-                  </div>
-              )
-            },
-          },
-        ],
       })
     }else if(projectType === 2){    //2软著
       this.setState({
@@ -1150,98 +879,6 @@ const Task = React.createClass({
             },
           },
         ],
-        //付款节点表头
-        PayNodeTableColunms: [
-          {
-            title: '供应商名称',
-            dataIndex: 'companyName',
-            key: 'companyName',
-            render: (text, record, index) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款科目',
-            dataIndex: 'dunType',
-            key: 'dunType',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '付款时间',
-            dataIndex: 'partyTimes',
-            key: 'partyTimes',
-            render: (text, record) => {
-              return <span>{text ? text : '/'}</span>
-            },
-          },
-          {
-            title: '数量',
-            dataIndex: 'quantity',
-            key: 'quantity',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '总价',
-            dataIndex: 'totalAmount',
-            key: 'totalAmount',
-            render: (text, record) => {
-              return <span>***</span>
-            },
-          },
-          {
-            title: '已付',
-            dataIndex: 'partyAmount',
-            key: 'partyAmount',
-            render: (text, record) => {
-              if (text) {
-                return <span>{text}</span>
-              }
-            },
-          },
-          {
-            title: '操作',
-            dataIndex: 'dels',
-            key: 'dels',
-            render: (text, record, index) => {
-              return (
-                  <div>
-                    <Popconfirm
-                        title="是否删除?"
-                        onConfirm={() => {
-                          this.payNodeConfirmDeletNew(record)
-                        }}
-                        okText="删除"
-                        cancelText="不删除"
-                    >
-                      <Button
-                          onClick={(e) => {
-                            e.stopPropagation()
-                          }}
-                          style={{
-                            marginRight: '10px',
-                            color: '#ffffff',
-                            background: '#f00',
-                            border: 'none',
-                          }}
-                      >
-                        删除
-                      </Button>
-                    </Popconfirm>
-                  </div>
-              )
-            },
-          },
-        ],
       })
     }else if(projectType === 1){       //1专利
       if(this.state.patentType === 0){      //专利申请
@@ -1597,6 +1234,100 @@ const Task = React.createClass({
         ]
       })
     }
+    this.setState({
+      //付款节点表头
+      PayNodeTableColunms: [
+        {
+          title: '供应商名称',
+          dataIndex: 'companyName',
+          key: 'companyName',
+          render: (text, record, index) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款科目',
+          dataIndex: 'dunType',
+          key: 'dunType',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款时间',
+          dataIndex: 'partyTimes',
+          key: 'partyTimes',
+          render: (text, record) => {
+            return <span>{text ? text : '/'}</span>
+          },
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          key: 'quantity',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '总价',
+          dataIndex: 'totalAmount',
+          key: 'totalAmount',
+          render: (text, record) => {
+            return <span>{text}</span>
+          },
+        },
+        {
+          title: '已付',
+          dataIndex: 'partyAmount',
+          key: 'partyAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '操作',
+          dataIndex: 'dels',
+          key: 'dels',
+          render: (text, record, index) => {
+            return (
+                <div>
+                  <Popconfirm
+                      title="是否删除?"
+                      onConfirm={() => {
+                        this.payNodeConfirmDeletNew(record)
+                      }}
+                      okText="删除"
+                      cancelText="不删除"
+                  >
+                    <Button
+                        onClick={(e) => {
+                          e.stopPropagation()
+                        }}
+                        style={{
+                          marginRight: '10px',
+                          color: '#ffffff',
+                          background: '#f00',
+                          border: 'none',
+                        }}
+                    >
+                      删除
+                    </Button>
+                  </Popconfirm>
+                </div>
+            )
+          },
+        },
+      ],
+    })
   },
   setColor() {
     $('.userName span').after(
@@ -2418,7 +2149,7 @@ const Task = React.createClass({
     }
     if (this.state.refundStatus === 1) {
       //专利
-      if (!this.state.patentType) {
+      if (this.state.patentType === -1) {
         message.warning('请选择专利类型')
         return
       }
@@ -2462,30 +2193,35 @@ const Task = React.createClass({
       ) */
     }, 3000)
 
+    let data = {
+      tid: this.state.id,
+      orderNo: this.state.orderNo,
+      type: 1,                                //分类 0订单  1项目
+      startType: this.state.startType,       //支付类型  0外包 1供应商 false 0
+      companyName: this.state.companyName,
+      amount: this.state.amount,
+      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) {
+      data.patentType = this.state.patentType;
+    }
+
     $.ajax({
       method: 'POST',
       dataType: 'json',
       crossDomain: false,
       url:
         globalConfig.context + '/api/admin/outsourceOrg/outsourceProjectAudit',
-      data: {
-        tid: this.state.id,
-        orderNo: this.state.orderNo,
-        type: 1,                                //分类 0订单  1项目
-        startType: this.state.startType,       //支付类型  0外包 1供应商 false 0
-        companyName: this.state.companyName,
-        amount: this.state.amount,
-        pictureUrl: this.getUrl(this.state.pictureUrl).length
-          ? this.getUrl(this.state.pictureUrl)
-          : '',
-        patentType:this.state.patentType,
-        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,
-      },
+      data: data,
     }).done(
       function (data) {
         this.setState({
@@ -2714,6 +2450,7 @@ const Task = React.createClass({
                 ? thisData.dunSubject.toString()
                 : '', //催款科目
               id: thisData.id, //节点Id
+              tid: thisData.tid, //节点指定的第三方id
               money: thisData.money, //催款金额
               // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
               commodityName: thisData.commodityName,
@@ -2983,21 +2720,7 @@ const Task = React.createClass({
     //获取当前供应商名称对应的单价并更新
     this.state.thirdInfoList.forEach((item) => {
       if (item.companyName === this.state.thirdCompanyName) {
-        // assets: null
-        // audit: 0
-        // cid: 15
-        // companyName: "测试1号-751"
-        // id: 751
-        // income: null
-        // key: 6
-        // material: 1
-        // quantity: 12
-        // remarks: "的修改V型分公司的"
-        // tid: 810
-        // totalAmount: 276
-        // unitPrice: 23
-        // urgent: 6
-        currentTotalPrice = num ? item.quantity * num : item.quantity * item.unitPrice;
+        currentTotalPrice = num ? item.unitPrice * num : item.quantity * item.unitPrice;
         currentTotalPrice = currentTotalPrice.toFixed(4);
         quantity = num ? num : item.quantity;
         unitPrice = item.unitPrice;
@@ -3012,14 +2735,6 @@ const Task = React.createClass({
         thirdUnitPrice: unitPrice
       })
     }
-    console.log(
-      'thirdUnitPrice:',
-      this.state.thirdUnitPrice,
-      'payNodeQuantity:',
-      this.state.payNodeQuantity,
-      'currentTotalPrice:',
-      currentTotalPrice
-    )
   },
   // 保存供应商信息
   handleCancelq() {
@@ -3103,9 +2818,6 @@ const Task = React.createClass({
       //新增
       api = '/api/admin/company/addPaymentNode'
     }
-    this.setState({
-      loading: true,
-    })
     //   totalAmount: this.state.currentTotalPrice, //总价
     //   partyAmount: this.state.partyAmount, //付款金额
     //
@@ -3117,6 +2829,18 @@ const Task = React.createClass({
         return true;
       }
     });
+    if(!this.state.thirdCompanyName){
+      message.error('请选择供应商名称');
+      return;
+    }
+    if(!this.state.paySubjectName){
+      message.error('请选择付款科目');
+      return;
+    }
+    if(!this.state.payNodeQuantity){
+      message.error('请输入数量');
+      return;
+    }
     let data = {
       id: this.state.ThirdId, //id
       tid: this.state.tid, //订单编号
@@ -3127,12 +2851,19 @@ const Task = React.createClass({
       projectType: this.state.cSort, //项目分类
     }
     if(this.state.paySubjectName === '0'){
+      if(!this.state.partyTimes){
+        message.error('请选择付款时间');
+        return;
+      }
       data.partyTimes = this.state.partyTimes //付款时间
     }
     if(this.state.projectType !== 2){                   //其他类型   0正常 1专利 2软著 3审计
       data.totalAmount = this.state.currentTotalPrice   //总价
       data.unitPrice = this.state.thirdUnitPrice        //单价
     }
+    this.setState({
+      loading: true,
+    })
     $.ajax({
       url: globalConfig.context + api,
       method: 'post',
@@ -3270,17 +3001,6 @@ const Task = React.createClass({
       thirdUrgent: record.urgent, //加急情况
       thirdRemarks: record.remarks,
     })
-    console.log({
-      ThirdListVisible: true,
-      ThirdId: record.id, //供应商id
-      thirdCompanyName: record.companyName, //第三方名称
-      thirdUnitPrice: record.unitPrice, //单价
-      thirdQuantity: record.quantity, //数量
-      currentTotalPrice: record.totalAmount, //总价
-      thirdMaterial: record.material, //有无材料
-      thirdUrgent: record.urgent, //加急情况
-      thirdRemarks: record.remarks,
-    })
   },
   //点击付款节点详情
   payNodeTableRowClickOne(record) {
@@ -4881,7 +4601,7 @@ const Task = React.createClass({
             </Spin>
           </Form>
         </Modal>
-        <Modal
+        {this.state.addnextVisible ? <Modal
           maskClosable={false}
           visible={this.state.addnextVisible}
           onOk={this.nextCancel}
@@ -4954,7 +4674,7 @@ const Task = React.createClass({
               </div>
             </Spin>
           </Form>
-        </Modal>
+        </Modal> : <div/>}
         <Modal
           maskClosable={false}
           visible={this.state.speVisible}
@@ -5870,7 +5590,15 @@ const Task = React.createClass({
             onCancel={()=>{
               this.thirdTable(this.state.tid);
               this.setState({
-                ThirdListVisible: false
+                ThirdListVisible: false,
+                ThirdId: '', //供应商id
+                thirdCompanyName: '', //第三方名称
+                thirdUnitPrice: '', //单价
+                thirdQuantity: '', //数量
+                currentTotalPrice: '', //总价
+                thirdMaterial: '', //有无材料
+                thirdUrgent: 0, //加急情况
+                thirdRemarks: '',
               })
             }}
             otherOperations={(data)=>{
@@ -5990,7 +5718,7 @@ const Task = React.createClass({
                     <Input
                       value={this.state.currentTotalPrice}
                       placeholder=""
-                      required="required"
+                      // required="required"
                       // onBlur={this.payNodeCalculatedAmount}
                       // onChange={(e) =>
                       //   this.setState({

+ 22 - 21
js/component/manageCenter/project/task/newSupplier.js

@@ -112,6 +112,22 @@ class NewSupplier extends Component{
             //新增
             api = '/api/admin/company/addCompany'
         }
+
+        if(!this.state.thirdCompanyName){
+            message.warning('请输入供应商名称')
+            return;
+        }
+
+        if(!this.state.thirdUnitPrice && this.props.projectType !== 2){
+            message.warning('请输入正确的单价')
+            return;
+        }
+
+        if(!this.state.thirdQuantity){
+            message.warning('请输入数量')
+            return;
+        }
+
         let customerId = 0;
         let isHave =this.state.customerArr.some((value)=>{
             if(value.companyName === this.state.thirdCompanyName){
@@ -124,22 +140,7 @@ class NewSupplier extends Component{
             message.warning('请输入正确的供应商名称')
             return;
         }
-        // if (this.props.projectType === 1 && this.props.patentType === 0) {
-        //     if(this.state.officialCost === ''){
-        //         message.warning("请选择官费!");
-        //         return false;
-        //     }
-        //     if (this.state.costReduction === "") {
-        //         message.warning("请选择费减!");
-        //         return false;
-        //     }
-        // }
-        this.setState({
-            loading: true,
-        })
-        // material: this.state.thirdMaterial, //材料
-        // urgent: this.state.thirdUrgent, //加急
-        // unitPrice: this.state.thirdUnitPrice, //单价
+
         let data = {
             id: this.props.ThirdId,                     //id
             tid: this.props.tid,                        //订单编号
@@ -158,10 +159,7 @@ class NewSupplier extends Component{
         }else{                                          //非软著类需要传总金额
             data.totalAmount = this.state.thirdQuantity * this.state.thirdUnitPrice;
         }
-        // if(this.props.projectType === 1 && this.props.patentType === 0){
-        //     data.officialCost  = this.state.officialCost; //是否有官费
-        //     data.costReduction = this.state.costReduction; //是否有费减
-        // }
+
         data.type = this.props.projectType === 1 ? (this.props.patentType === 0 ? 1 : 2) : 0   //0其他 1专利申请 2专利买卖
         if(this.props.projectType === 3){
             if(!this.state.assets){
@@ -182,6 +180,10 @@ class NewSupplier extends Component{
             data.audit = this.state.audit;   //0无审计 1年审 2专审
             data.income = this.state.income;   //收入
         }
+
+        this.setState({
+            loading: true,
+        })
         $.ajax({
             url: globalConfig.context + api,
             method: 'post',
@@ -274,7 +276,6 @@ class NewSupplier extends Component{
                                     <Input
                                         value={this.state.thirdQuantity}
                                         placeholder="请输入数量(必填项)"
-                                        required="required"
                                         onBlur={this.calculatedAmount}
                                         type={'number'}
                                         onChange={(e) => {