Quellcode durchsuchen

付款节点新增

mentoswzq vor 4 Jahren
Ursprung
Commit
04a0d9efdc

+ 0 - 27
js/component/manageCenter/order/orderNew/addService.jsx

@@ -1234,33 +1234,6 @@ const NewService = Form.create()(
                     this.state.getLoad && record.sortName ? true : false
                   }
                   onChange={(e) => {
-                    // let num = e.lastIndexOf("-");
-                    // let ctid = e.substr(num + 1);
-                    // record.sortName = e.substring(0, num);
-                    // dataArr.forEach((item) => {
-                    //   if (
-                    //     item.commodityName == record.sortName &&
-                    //     ctid == item.id
-                    //   ) {
-                    //     record.cname = item.cname;
-                    //     record.ctid = item.id;
-                    //     record.isSave = true;
-                    //     record.sort = item.cSort;
-                    //     cuiJieDian.forEach((item) => {
-                    //       if (item.value == record.sort) {
-                    //         record.arr = item.children;
-                    //         let yearFlag = true;
-                    //         if (record.sort == 6) {
-                    //           yearFlag = false;
-                    //         }
-                    //         this.setState({
-                    //           getLoad: true,
-                    //           yearFlag,
-                    //         });
-                    //       }
-                    //     });
-                    //   }
-                    // });
                     let proData = dataArr[e];
                     record.cname = proData.cname;
                     record.ctid = proData.id;

+ 42 - 116
js/component/manageCenter/project/task/myTask.jsx

@@ -209,12 +209,13 @@ const Task = React.createClass({
   },
   getInitialState() {
     return {
-      PayNodeCompany:'',
+      PayNodeCompany:[],
       thirdMaterial: 0, //第三方信息材料 0-无 1-有
       thirdUrgent: 0, //第三方信息加急状态
       thirdCompanyName: '',
       thirdUnitPrice: '',
       thirdQuantity: 1,
+      payNodeQuantity: 1,
       thirdRemarks: '',
       customerArr: [],
       currentTotalPrice: 0, //当前修改页面的总价
@@ -767,7 +768,9 @@ const Task = React.createClass({
           dataIndex: 'partyAmount',
           key: 'partyAmount',
           render: (text, record) => {
-            return getMaterialStatus(text)
+            if (text) {
+              return <span>{text}</span>
+            }
           },
         },
         {
@@ -775,7 +778,9 @@ const Task = React.createClass({
           dataIndex: 'partyTimes',
           key: 'partyTimes',
           render: (text, record) => {
-            return getUrgentStatus(text)
+            if (text) {
+              return <span>{text}</span>
+            }
           },
         },
         {
@@ -811,30 +816,7 @@ const Task = React.createClass({
             )
           },
         },
-      ],
-      PayNodeOptions: [{
-        value: 'zhejiang',
-        label: 'Zhejiang',
-        children: [{
-          value: 'hangzhou',
-          label: 'Hangzhou',
-          children: [{
-            value: 'xihu',
-            label: 'West Lake',
-          }],
-        }],
-      }, {
-        value: 'jiangsu',
-        label: 'Jiangsu',
-        children: [{
-          value: 'nanjing',
-          label: 'Nanjing',
-          children: [{
-            value: 'zhonghuamen',
-            label: 'Zhong Hua Men',
-          }],
-        }],
-      }]
+      ]
     }
   },
   /* 分派 */
@@ -1523,6 +1505,7 @@ const Task = React.createClass({
     this.state.reviewDate = '' //评审日期
     this.state.publicityDate = '' //公示日期
     this.state.licenceDate = '' //发证日期
+    this.state.partyTimes = ''//付款时间
     attachmentUrl: [] //附件
     this.state.contacts = '' //联系人
     this.state.contactMobile = '' //联系人电话
@@ -2078,13 +2061,11 @@ const Task = React.createClass({
             allTotalAmount = 0
           }
           console.log(theArr)
-          // console.log(companyNameArr);
-          window.localStorage.setItem(
-            'companyNameList',
-            JSON.stringify(companyNameArr)
-          )
+          console.log(companyNameArr);
+          
           this.setState({
             tid: id,
+            PayNodeCompany:companyNameArr,
             thirdInfoList: theArr,
             allTotalAmount: allTotalAmount,
           })
@@ -2117,10 +2098,8 @@ const Task = React.createClass({
           let payNodeArr = []
           let thisData = []
           let arr = data.data || []
-          let allTotalAmount = 0
           for (let i = 0; i < arr.length; i++) {
             thisData = arr[i]
-            allTotalAmount += +thisData.totalAmount
             payNodeArr.push({
               key: i,
               id: thisData.id, //付款节点Id
@@ -2136,14 +2115,10 @@ const Task = React.createClass({
               cid: thisData.cid, //机构id
             })
           }
-          if (!allTotalAmount) {
-            allTotalAmount = 0
-          }
           console.log(payNodeArr)
           this.setState({
             tid: id,
             payNodeList: payNodeArr,
-            allTotalAmount: allTotalAmount,
           })
         }
       }.bind(this),
@@ -2167,7 +2142,7 @@ const Task = React.createClass({
       PayNodeVisible: true,
     })
   },
-  // 自动计算总金额
+  // 第三方信息自动计算总金额
   calculatedAmount() {
     let currentTotalPrice
     currentTotalPrice = this.state.thirdUnitPrice * this.state.thirdQuantity
@@ -2176,6 +2151,15 @@ const Task = React.createClass({
       currentTotalPrice: currentTotalPrice,
     })
   },
+  // 付款节点自动计算总金额
+  payNodeCalculatedAmount() {
+    let currentTotalPrice
+    currentTotalPrice = this.state.thirdUnitPrice * this.state.payNodeQuantity
+    currentTotalPrice = currentTotalPrice.toFixed(4)
+    this.setState({
+      currentTotalPrice: currentTotalPrice,
+    })
+  },
   //服务值改变时请求供应商名称
   httpChange(e) {
     if (e.length >= 1) {
@@ -2393,7 +2377,7 @@ const Task = React.createClass({
   //点击供应商详情
   tableRowClickOne(record) {
     this.setState({
-      ThirdListVisible: true,
+      ThirdListVisible:true,
       ThirdId: record.id, //供应商id
       thirdCompanyName: record.companyName, //第三方名称
       thirdUnitPrice: record.unitPrice, //单价
@@ -2407,7 +2391,7 @@ const Task = React.createClass({
   //点击付款节点详情
   payNodeTableRowClickOne(record) {
     this.setState({
-      ThirdListVisible: true,
+      PayNodeVisible: true,
       ThirdId: record.id, //供应商id
       thirdCompanyName: record.companyName, //第三方名称
       thirdUnitPrice: record.unitPrice, //单价
@@ -4786,30 +4770,6 @@ const Task = React.createClass({
                       />
                     </FormItem>
                   </div>
-                  {/*<div className="clearfix">
-										<FormItem className="half-item"
-										    {...formItemLayout}
-										    label="上传协议文件" style={{height:"auto"}}>  
-										     <Upload header={{authorization: 'authorization-text'}} action={globalConfig.context + "/api/admin/outsourceOrg/uploadOutsourceFile"}
-													data={(e)=>{
-														return {
-															'sign': e.name.substring(0,e.name.lastIndexOf("."))
-														}
-													}}
-													fileList={this.state.fileUrl}
-													onChange={(e)=>{
-														this.setState({
-															attachmentUrl:e.fileList,
-															fileUrl:e.fileList
-														})
-													}}>
-												{fileUrl.length>1?null:<Button>
-												<Icon type="upload" /> 点击上传
-												</Button>}
-										    </Upload>
-										    <span className="tip" style={{display:"inline-block"}}>支持文件格式: doc,excel,ppt</span>
-										</FormItem>
-									</div>*/}
                   <p
                     className="tip"
                     style={{
@@ -4906,26 +4866,6 @@ const Task = React.createClass({
                       <span>{this.state.outsourceRemarks}</span>
                     </FormItem>
                   </div>
-                  {/*<div className="clearfix">
-										<FormItem className="half-item" style={{height:'auto'}}
-										    {...formItemLayout}
-										    label="上传协议文件" >  
-											<Upload header={{authorization: 'authorization-text'}} action={globalConfig.context + "/api/admin/outsourceOrg/uploadOutsourceFile"}
-													data={(e)=>{
-														return {
-															'sign': e.name.substring(0,e.name.lastIndexOf("."))
-														}
-													}}
-													fileList={this.state.fileUrl}
-													showUploadList={{showRemoveIcon:false}}
-													onPreview={(e)=>{
-														let url = window.location.href.substring(7)
-														window.location.href="http://"+url.substring(0,url.indexOf("/"))+"/api/admin/outsourceOrg//downloadFile?path="+e.response.data
-													}}
-													>
-											</Upload>
-										</FormItem>
-									</div>*/}
                   <div className="clearfix">
                     <FormItem
                       labelCol={{ span: 4 }}
@@ -5165,18 +5105,6 @@ const Task = React.createClass({
                 </div>
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="加急">
-                    {/* <Input
-                      value={this.state.thirdQuantity}
-                      placeholder="请输入数量(必填项)"
-                      required="required"
-                      onBlur={this.calculatedAmount}
-                      onChange={(e) => {
-                        this.setState({
-                          thirdQuantity: e.target.value,
-                        });
-                      }}
-                      style={{ width: "220px" }}
-                    /> */}
                     <Select
                       value={getUrgentStatus(this.state.thirdUrgent)}
                       onChange={(val) => {
@@ -5267,13 +5195,11 @@ const Task = React.createClass({
                   <FormItem {...formItemLayout} label="供应商名称">
                     <Select onChange={(val) => {
                         this.setState({
-                          thirdUrgent: val,
+                          thirdCompanyName: val,
                         })
                       }} defaultValue="请选择供应商" style={{ width: 220 }}>
-                      {JSON.parse(
-                        window.localStorage.getItem('companyNameList')
-                      ).map((item, index) => (
-                        <Select.Option key={index}>{item}</Select.Option>
+                      {this.state.PayNodeCompany.map((item, index) => (
+                        <Select.Option value={item} key={index}>{item}</Select.Option>
                       ))}
                     </Select>
                     <span className="mandatory">*</span>
@@ -5282,31 +5208,35 @@ const Task = React.createClass({
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="付款科目">
                   <Select defaultValue="请选择付款科目" style={{ width: 220 }}>
-                    {
+                    {/* {
                  JSON.parse(
                   window.localStorage.getItem('paySubject')
                 ).map((item, index) => <Select.Option value={item.value} key={index}>{item.key}</Select.Option>)
-                 }
+                 } */}
                   </Select>
                     <span className="mandatory">*</span>
                   </FormItem>
                 </div>
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="付款时间">
-                    <DatePicker style={{ width: '220px' }} />
+                    <DatePicker value={ this.state.partyTimes? moment(this.state.partyTimes):null }
+                    onChange={(data,dataString)=>{
+                      this.setState({ partyTimes:dataString })
+                    }}
+                    style={{ width: '220px' }} />
                     <span className="mandatory">*</span>
                   </FormItem>
                 </div>
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="数量">
                     <Input
-                      value={this.state.thirdQuantity}
+                      value={this.state.payNodeQuantity}
                       placeholder="请输入数量(必填项)"
                       required="required"
                       onBlur={this.calculatedAmount}
                       onChange={(e) => {
                         this.setState({
-                          thirdQuantity: e.target.value,
+                          payNodeQuantity: e.target.value,
                         })
                       }}
                       style={{ width: '220px' }}
@@ -5316,19 +5246,15 @@ const Task = React.createClass({
                 </div>
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="总价(万元)">
-                    <span>{this.state.currentTotalPrice}</span>
-                  </FormItem>
-                </div>
-                <div className="clearfix">
-                  <FormItem {...formItemLayout} label="付款">
+                    {/* <span>{this.state.currentTotalPrice}</span> */}
                     <Input
-                      value={this.state.thirdQuantity}
-                      placeholder="付款金额"
+                      value={this.state.currentTotalPrice}
+                      placeholder=""
                       required="required"
-                      onBlur={this.calculatedAmount}
+                      onBlur={this.payNodeCalculatedAmount}
                       onChange={(e) => {
                         this.setState({
-                          thirdQuantity: e.target.value,
+                          toltalAmount: e.target.value,
                         })
                       }}
                       style={{ width: '220px' }}