Browse Source

转交类型增加
财务专员、财务经理、财务总监查看完全的外包成本信息

mentoswzq 4 years ago
parent
commit
fe6efe22ba

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

@@ -8,7 +8,7 @@ import {
   Tag,
   Button,
   message,
-  Row,
+  Tooltip,
   Popconfirm,
 } from 'antd'
 import {getProjectStatus,} from '@/tools'
@@ -318,6 +318,18 @@ class CheckProject extends Component {
             title: '备注',
             dataIndex: 'remarks',
             key: 'remarks',
+            render: (text) => {
+              return (
+                  <Tooltip placement="topLeft" title={text}>
+                      <div style={{
+                        maxWidth:'150px',
+                        overflow:'hidden',
+                        textOverflow: "ellipsis",
+                        whiteSpace:'nowrap',
+                      }}>{text}</div>
+                  </Tooltip>
+              )
+            }
           },
           {
             title: '操作',
@@ -559,6 +571,18 @@ class CheckProject extends Component {
               title: '备注',
               dataIndex: 'remarks',
               key: 'remarks',
+              render: (text) => {
+                return (
+                    <Tooltip placement="topLeft" title={text}>
+                        <div style={{
+                          maxWidth:'150px',
+                          overflow:'hidden',
+                          textOverflow: "ellipsis",
+                          whiteSpace:'nowrap',
+                        }}>{text}</div>
+                    </Tooltip>
+                )
+              }
             },
             {
               title: '操作',
@@ -679,6 +703,18 @@ class CheckProject extends Component {
               title: '备注',
               dataIndex: 'remarks',
               key: 'remarks',
+              render: (text) => {
+                return (
+                    <Tooltip placement="topLeft" title={text}>
+                      <div style={{
+                        maxWidth:'150px',
+                        overflow:'hidden',
+                        textOverflow: "ellipsis",
+                        whiteSpace:'nowrap',
+                      }}>{text}</div>
+                    </Tooltip>
+                )
+              }
             },
             {
               title: '操作',

+ 3 - 1
js/component/manageCenter/financialManage/distribute/shouKuanAll.jsx

@@ -2416,6 +2416,7 @@ const ShouKuang = React.createClass({
             <Project
               record={this.state.record}
               visible={this.state.pvisible}
+              isAuditPaymentGLY={true}
               cancel={() => {
                 this.setState({ pvisible: false });
               }}
@@ -2565,7 +2566,7 @@ const ShouKuang = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               proVisible: false,
             });
@@ -2575,6 +2576,7 @@ const ShouKuang = React.createClass({
             <Project
               record={this.state.record}
               visible={this.state.pvisible}
+              isAuditPaymentGLY={true}
               cancel={() => {
                 this.setState({ pvisible: false });
               }}

+ 3 - 1
js/component/manageCenter/financialManage/distribute/shouKuang.jsx

@@ -2555,6 +2555,7 @@ const ShouKuang = React.createClass({
             <Project
               record={this.state.record}
               visible={this.state.pvisible}
+              isAuditPayment={true}
               cancel={() => {
                 this.setState({ pvisible: false });
               }}
@@ -2704,7 +2705,7 @@ const ShouKuang = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               proVisible: false,
             });
@@ -2714,6 +2715,7 @@ const ShouKuang = React.createClass({
             <Project
               record={this.state.record}
               visible={this.state.pvisible}
+              isAuditPayment={true}
               cancel={() => {
                 this.setState({ pvisible: false });
               }}

+ 224 - 84
js/component/project.jsx

@@ -26,10 +26,17 @@ import {
 const FormItem = Form.Item
 import ResolutionDetail from '@/resolutionDetail'
 import ImgList from "./common/imgList";
+import CheckProject from "./manageCenter/components/checkProject";
+import { cuiJieDian } from '@/dataDic.js'
 const { TabPane } = Tabs
 const project = React.createClass({
   getInitialState() {
     return {
+      oldInfor:{},
+      patentNameType: -1,
+      patentType: -1,
+      paySubject: [],
+
       visible: false,
       record: this.props.record,
       paginations: false,
@@ -263,6 +270,7 @@ const project = React.createClass({
             outsourceName: thisdata.outsourceName, //外包公司名称
             outsourcePrice: thisdata.outsourcePrice, //外包价格
             declarationBatch: thisdata.declarationBatch, //外包价格
+            projectType: thisdata.bpType,//项目类型
           })
         }
       }.bind(this),
@@ -274,6 +282,16 @@ const project = React.createClass({
       }.bind(this)
     )
   },
+  // 获取csort下的数据
+  getCsortData(cSort) {
+    cuiJieDian.map((item) => {
+      if (item.value == cSort) {
+        this.setState({
+          paySubject: item.children,
+        })
+      }
+    })
+  },
   //订单详情
   xiangqings(orderNos) {
     this.setState({
@@ -517,7 +535,35 @@ const project = React.createClass({
           loading: false,
         })
         if (!data.error.length && data.data) {
+          if(!isNaN(parseFloat(data.data.unitNumber))){
+            this.setState({
+              oldInfor: {
+                companyName:data.data.companyName,
+                unitPrice:data.data.unitPrice,
+                unitNumber:data.data.unitNumber,
+                amount:data.data.amount,
+                outsourceRemarks:data.data.outsourceRemarks,
+                refundStatus: data.data.refundStatus,
+                pictureUrl: data.data.pictureUrl
+                    ? splitUrl(
+                        data.data.pictureUrl,
+                        ',',
+                        globalConfig.avatarHost + '/upload',
+                        url
+                    )
+                    : [], //图片地址
+              },
+            })
+          }else{
+            this.setState({
+              oldInfor: {},
+            })
+          }
           this.setState({
+            startType: data.data.startType, //类型
+            patentType: data.data.patentType, //专利类型
+            patentNameType: data.data.patentNameType, //专利名称类型
+            patentName: data.data.patentName, //专利名称
             outsourceRemarks: data.data.outsourceRemarks,
             remarks: data.data.remarks,
             companyName: data.data.companyName,
@@ -604,11 +650,160 @@ const project = React.createClass({
       tabsKey:e
     })
     if (e == 2) {
-      this.waiDetail()
+      this.waiDetail();
+      this.payNodeTable();
+      this.thirdTable();
+      this.getCsortData();
     } else if (e == 3) {
       this.loadCompany()
     }
   },
+  //查看第三方信息表格
+  thirdTable() {
+    this.setState({
+      thirdInfoLoading: true,
+    })
+    let ajaxObj = $.ajax({
+      method: 'get',
+      dataType: 'json',
+      crossDomain: false,
+      url: globalConfig.context + '/api/admin/company/selectCompany',
+      data: {
+        tid: this.props.record.id,
+      },
+      success: function (data) {
+        if (data.error && data.error.length) {
+          message.warning(data.error[0].message)
+        } else {
+          let companyNameArr = [];
+          let theArr = [];
+          let thisData = [];
+          let arr = data.data || [];
+          let allTotalAmount = 0;
+          let type = 0;
+          let startType = 0;
+          let patentNameType = 0;
+          for (let i = 0; i < arr.length; i++) {
+            thisData = arr[i]
+            allTotalAmount =
+                (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000
+            companyNameArr.push(thisData.companyName);
+            thisData.key = i;
+            type=thisData.patentType;
+            thisData.patentType = thisData.type;
+            theArr.push(thisData);
+            startType=thisData.startType;
+            patentNameType= thisData.patentNameType
+          }
+          if (!allTotalAmount) {
+            allTotalAmount = 0
+          }
+
+          for(let d=0;d<theArr.length;d++){
+            theArr[d].companyName = theArr[d].companyName+ '-' + theArr[d].id;
+            companyNameArr[d] = {
+              companyName: theArr[d].companyName,
+              id: theArr[d].id,
+            }
+          }
+
+          if(type === 0 || type === 1){
+            this.setState({
+              patentType: type === 0 ? 0 : 1,    //0专利申请 1专利买卖
+              patentNameType: patentNameType,                         //0实用新型 1发明专利 2外观专利 3 其他
+            })
+          }
+
+          //设置项目类型
+          if(arr.length >0){
+            this.setState({
+              startType: startType
+            })
+          }
+
+          this.setState({
+            thirdInfoList: theArr,
+          })
+        }
+      }.bind(this),
+    }).always(
+        function () {
+          this.setState({
+            thirdInfoLoading: false,
+          })
+        }.bind(this)
+    )
+    this.setState({
+      selectCompanyAjaxObj:ajaxObj
+    })
+  },
+  payNodeTable() {
+    this.setState({
+      payNodeLoading: true,
+    })
+    let ajaxObj = $.ajax({
+      method: 'get',
+      dataType: 'json',
+      crossDomain: false,
+      url: globalConfig.context + '/api/admin/company/selectPaymentNode',
+      data: {
+        tid: this.props.record.id,
+      },
+      success: function (data) {
+        if (data.error && data.error.length) {
+          message.warning(data.error[0].message)
+        } else {
+          let payNodeArr = []
+          let thisData = []
+          let arr = data.data || []
+          //对#5283自定义的补充展示
+          this.state.paySubject.push({ key: '自定义', value: '0' })
+          for (let i = 0; i < arr.length; i++) {
+            thisData = arr[i]
+            //遍历paySubject,获取当前dunType对应的key
+            this.state.paySubject.map((item) => {
+              if (item.value == thisData.dunType) {
+                thisData.dunType = item.key
+              }
+            })
+            payNodeArr.push({
+              key: i,
+              id: thisData.id, //付款节点Id
+              nodeId:  thisData.id, //付款节点Id
+              tid: thisData.tid,
+              companyName: thisData.companyName, //供应商名称
+              projectType: thisData.projectType, //项目分类
+              dunType: thisData.dunType, //催款分类
+              unitPrice: thisData.unitPrice, //单价
+              quantity: thisData.quantity, //数量
+              totalAmount: thisData.totalAmount, //总价
+              partyAmount: thisData.partyAmount, //付款
+              partyTimes: thisData.partyTimes, //付款时间
+              cid: thisData.cid, //机构id
+              status: thisData.status, //催款状态 0-未支付 1-待全款 ,2已全款   status=2的时候已经全款,申请付款按钮可以去掉了
+            })
+          }
+
+          for(let d=0;d<payNodeArr.length;d++){
+            payNodeArr[d].companyName = payNodeArr[d].companyName+ '-' + payNodeArr[d].cid;
+          }
+
+          this.setState({
+            payNodeList: payNodeArr,
+          })
+        }
+      }.bind(this),
+    }).always(
+        function () {
+          this.setState({
+            payNodeLoading: false,
+          })
+        }.bind(this)
+    )
+    this.setState({
+      selectPaymentNodeAjaxObj: ajaxObj
+    })
+  },
   render() {
     const formItemLayout = {
       labelCol: { span: 8 },
@@ -1137,87 +1332,32 @@ const project = React.createClass({
             <TabPane tab="外包审核信息" key="2">
               {this.state.tabsKey === "2" ? <Spin spinning={this.state.loading}>
                 <div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="外包公司"
-                    >
-                      <span>{this.state.companyName}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="单价(万元)"
-                    >
-                      <span>{this.state.unitPrice}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="数量(个)"
-                    >
-                      <span>{this.state.unitNumber}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="总金额(万元)"
-                    >
-                      <span>{this.state.amount}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="备注"
-                    >
-                      <span>{this.state.outsourceRemarks}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      labelCol={{ span: 4 }}
-                      wrapperCol={{ span: 18 }}
-                      label="合同/协议扫描件"
-                    >
-                      {/*<Upload*/}
-                      {/*  className="demandDetailShow-upload"*/}
-                      {/*  listType="picture-card"*/}
-                      {/*  fileList={this.state.pictureUrl}*/}
-                      {/*  onPreview={(file) => {*/}
-                      {/*    this.setState({*/}
-                      {/*      previewImage: file.url || file.thumbUrl,*/}
-                      {/*      previewVisible: true,*/}
-                      {/*    })*/}
-                      {/*  }}*/}
-                      {/*/>*/}
-                      {this.state.tabsKey === "2" && this.state.pictureUrl && this.state.visible ? <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
-                        <ImgList fileList={this.state.pictureUrl} ItemWidth={'96px'}/>
-                      </div> : <div/>}
-                      <Modal
-                        maskClosable={false}
-                        footer={null}
-                        visible={this.state.previewVisible}
-                        onCancel={() => {
-                          this.setState({ previewVisible: false })
-                        }}
-                      >
-                        <img
-                          alt=""
-                          style={{ width: '100%' }}
-                          src={this.state.previewImage || ''}
-                        />
-                      </Modal>
-                    </FormItem>
-                  </div>
+                  {
+                    this.state.visible && this.state.tabsKey === '2' ?
+                        <CheckProject
+                            {...this.props}
+                            tid={this.props.record.id}
+                            oldInfor={this.state.oldInfor}
+                            projectType={this.state.projectType}    //0正常 1专利 2软著 3审计
+                            patentNameType={this.state.patentNameType}
+                            isAuditPayment={this.props.isAuditPayment}       //是否为财务
+                            isAuditPaymentGLY={this.props.isAuditPaymentGLY} //是否为财务经理或者为财务管理员
+                            patentName={this.state.patentName}
+                            patentType={this.state.patentType}
+                            status={this.state.refundStatus}
+                            thirdInfoList={this.state.thirdInfoList}
+                            dataSource={this.state.payNodeList}
+                            outsourceRemarks={this.state.outsourceRemarks}
+                            fileList={this.state.pictureUrl}
+                            startType={this.state.startType}
+                            projectStatus={this.state.projectStatus}
+                            onRefresh={()=>{
+                              this.waiDetail();
+                              this.thirdTable();
+                              this.payNodeTable()
+                            }}
+                        /> : <div/>
+                  }
                 </div>
 
                 <div className="clearfix">
@@ -1236,7 +1376,7 @@ const project = React.createClass({
                       <span>{this.state.remarks}</span>
                     </FormItem>
                   </div>
-                  <div className="clearfix">
+                  {!(this.state.oldInfor && Object.keys(this.state.oldInfor).length > 0) ? <div className="clearfix">
                     <FormItem
                       className="half-item"
                       {...formItemLayout}
@@ -1244,7 +1384,7 @@ const project = React.createClass({
                     >
                       <span>{getRefundStatus(this.state.refundStatus)}</span>
                     </FormItem>
-                  </div>
+                  </div> : <div/>}
                   <div
                     className="clearfix"
                     style={{

+ 16 - 7
js/component/zhuanjiaoDetail.jsx

@@ -17,7 +17,7 @@ const ZhuanjiaoDetail = React.createClass({
           key: "userName",
         },
         {
-          title: "管理员",
+          title: "管理员",
           dataIndex: "usedAName",
           key: "usedAName",
         },
@@ -26,16 +26,25 @@ const ZhuanjiaoDetail = React.createClass({
           dataIndex: "newAName",
           key: "newAName",
         },
+        //  0录入 1 领取 2 转交客户 3转交业务 4 未跟进丢失(30) 5未签单丢失(270天) 6移除
         {
           title: "转交类型",
           dataIndex: "type",
           key: "type",
           render: text => {
-            if(text == 1) {
-              return "项目转交"
-            }else {
-              return "客户转交"
-            }
+            return (
+                <span>
+                  {
+                    text === 0 ? "录入":
+                        text === 1 ? "领取":
+                            text === 2 ? "转交客户":
+                                text === 3 ? "转交业务":
+                                    text === 4 ? "未跟进丢失(30天)":
+                                        text === 5 ? "未签单丢失(270天)" :
+                                            text === 6 ? "移除" : ""
+                  }
+                </span>
+            )
           }
         },
         {
@@ -94,7 +103,7 @@ const ZhuanjiaoDetail = React.createClass({
         visible={this.props.visible}
         onCancel={this.props.cancel}
         footer={null}
-        width={600}
+        width={800}
         destroyOnClose={true}
       >
         <Spin spinning={this.state.loading} >