소스 검색

外包类型当普通单处理

mentoswzq 4 년 전
부모
커밋
7ab34e28b1

+ 1 - 2
js/component/manageCenter/components/checkProject/applyPaymentModal.js

@@ -173,8 +173,7 @@ class ApplyPaymentModal extends Component{
                                 {/*可以查看单价	正常  审计 专利买卖
                                    软著 专利申请 打星号  */}
                                 {
-                                        this.props.projectType === 2 || (this.props.projectType === 1 && this.props.patentType === 0)?
-                                        '***' :
+                                    isNaN(parseFloat(previewPayInfor.unitPrice)) ? previewPayInfor.unitPrice :
                                         getFieldDecorator('unitPrice', {
                                         initialValue:previewPayInfor.unitPrice,
                                         rules: [{ required: true, message: '请输入单价!' }],

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

@@ -260,7 +260,7 @@ class CheckProject extends Component {
         },
       ],
     })
-    if(projectType === 0 || !projectType){       //0正常 1专利 2软著 3审计
+    if(projectType === 0 || !projectType || this.props.startType === 0){       //0正常 1专利 2软著 3审计      this.props.startType 0外包 1供应商     外包时当普通单处理
       this.setState({
         ContactsListsNew: [
           {
@@ -1042,8 +1042,8 @@ class CheckProject extends Component {
                     </Spin>
                   </div>
                 </div>
-                {/*如果是软著类或者专利类的专利申请,隐藏付款节点*/}
-                {!((this.props.projectType === 1 && this.props.patentType === 0) || this.props.projectType === 2) ? <div className="thirdParty">
+                {/*如果是软著类或者专利类的专利申请,隐藏付款节点但当为外包类型时,无需隐藏*/}
+                {(!((this.props.projectType === 1 && this.props.patentType === 0) || this.props.projectType === 2)) || this.props.startType === 0 ? <div className="thirdParty">
                   <div>
             <span className="title">
               付款节点

+ 13 - 1
js/component/manageCenter/order/orderNew/outsourcingPro.jsx

@@ -35,6 +35,7 @@ import ShowModalDiv from "@/showModal.jsx";
 import ResolutionDetail from "@/resolutionDetail";
 const confirm = Modal.confirm;
 import CheckProject from '../../components/checkProject'
+import { taskStatus, projectStatus, cuiJieDian } from '@/dataDic.js'
 import OrderRiZi from "@/orderRiZi.jsx";
 import ImgList from "../../../common/imgList";
 //图片组件
@@ -860,6 +861,16 @@ const outsourcingPro = Form.create()(
           }.bind(this)
       )
     },
+    // 获取csort下的数据
+    getCsortData(cSort) {
+      cuiJieDian.map((item) => {
+        if (item.value == cSort) {
+          this.setState({
+            paySubject: item.children,
+          })
+        }
+      })
+    },
     payNodeTable(id) {
       $.ajax({
         method: 'get',
@@ -1018,7 +1029,8 @@ const outsourcingPro = Form.create()(
       this.thirdTable(record.tid);
       //获取支付节点信息表格
       this.payNodeTable(record.tid);
-
+      // 获取Csort
+      this.getCsortData(localStorage.getItem('cSort'))
       let url = window.location.href.substring(7);
 
       $.ajax({

+ 66 - 21
js/component/manageCenter/project/task/myTask.jsx

@@ -655,7 +655,7 @@ const Task = React.createClass({
   },
   //用于判断 第三方信息表格显示
   projectTypeTabContent(projectType) {
-    if(projectType === 0 || !projectType){       //0正常 1专利 2软著 3审计
+    if(projectType === 0 || !projectType || this.state.startType === 0){       //0正常 1专利 2软著 3审计      this.state.startType 0外包 1供应商     外包时当普通单处理
       this.setState({
         ContactsListsNew: [
           {
@@ -4224,7 +4224,29 @@ const Task = React.createClass({
                       <Radio.Group
                         value={this.state.startType}
                         onChange={(e) => {
-                          this.setState({ startType: e.target.value })
+                            let _this = this;
+                            if(this.state.thirdInfoList.length >0){
+                                confirm({
+                                    title: '确定要切换吗?',
+                                    content: '切换将删除所有第三信息和付款节点',
+                                    onOk() {
+                                        return new Promise((resolve, reject) => {
+                                            _this.setState({ startType: e.target.value },()=>{
+                                                _this.projectTypeTabContent(_this.state.projectType);
+                                            })
+                                            _this.confirmDeletNew(-1,resolve,reject)
+                                            if(_this.state.payNodeList.length > 0){
+                                                _this.payNodeConfirmDeletNew(-1,resolve,reject);
+                                            }
+                                        }).catch(() => console.log('Oops errors!'));
+                                    },
+                                    onCancel() {},
+                                });
+                            }else{
+                                this.setState({ startType: e.target.value },()=>{
+                                    this.projectTypeTabContent(this.state.projectType);
+                                })
+                            }
                         }}
                       >
                         <Radio value={0}>外包(不走总部)</Radio>
@@ -4373,12 +4395,12 @@ const Task = React.createClass({
                     <Button
                       type="primary"
                       onClick={(e) => {
-                        if(this.state.projectType === 1 && this.state.patentType === -1){
+                        //this.state.startType 0外包 1供应商   类型为外包时,当普通单
+                        if(this.state.projectType === 1 && this.state.patentType === -1 && this.state.startType === 1){
                           message.info('请先选择专利类型');
-                        }else if(this.state.projectType === 1 && this.state.patentNameType === -1){
+                        }else if(this.state.projectType === 1 && this.state.patentNameType === -1 && this.state.startType === 1){
                           message.info('请先选择专利名称');
-                        }
-                        else{
+                        } else{
                           this.addThirdList()
                         }
                       }}
@@ -4417,10 +4439,11 @@ const Task = React.createClass({
                       </Form>
                     </Spin>
                   </div>
-                  {/*如果是软著类或者专利类的专利申请,隐藏付款节点*/}
+                  {/*如果是软著类或者专利类的专利申请,隐藏付款节点 但当为外包类型时,无需隐藏*/}
+                  {/*this.state.startType 0外包 1供应商*/}
                   <div
                     style={{
-                      display: (this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block',  //0正常 1专利 2软著 3审计
+                      display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block'),  //0正常 1专利 2软著 3审计
                     }}
                   >
                     <span
@@ -4437,7 +4460,7 @@ const Task = React.createClass({
                         marginLeft: 10,
                         color: 'red',
                       }}
-                    ></span>
+                    />
                     <Button
                       type="primary"
                       onClick={(e) => {
@@ -4452,11 +4475,11 @@ const Task = React.createClass({
                       +新增付款节点
                     </Button>
                   </div>
-                  {/*如果是软著类或者专利类的专利申请,隐藏付款节点*/}
+                  {/*如果是软著类或者专利类的专利申请,隐藏付款节点 但当为外包类型时,无需隐藏*/}
                   <div
                     className="clearfix"
                     style={{
-                      display: (this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block',  //0正常 1专利 2软著 3审计
+                      display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block'),  //0正常 1专利 2软著 3审计
                     }}
                   >
                     <Spin spinning={this.state.loading}>
@@ -5478,7 +5501,29 @@ const Task = React.createClass({
                         <Radio.Group
                             value={this.state.startType}
                             onChange={(e) => {
-                              this.setState({ startType: e.target.value })
+                                let _this = this;
+                                if(this.state.thirdInfoList.length >0){
+                                    confirm({
+                                        title: '确定要切换吗?',
+                                        content: '切换将删除所有第三信息和付款节点',
+                                        onOk() {
+                                            return new Promise((resolve, reject) => {
+                                                _this.setState({ startType: e.target.value },()=>{
+                                                    _this.projectTypeTabContent(_this.state.projectType);
+                                                })
+                                                _this.confirmDeletNew(-1,resolve,reject)
+                                                if(_this.state.payNodeList.length > 0){
+                                                    _this.payNodeConfirmDeletNew(-1,resolve,reject);
+                                                }
+                                            }).catch(() => console.log('Oops errors!'));
+                                        },
+                                        onCancel() {},
+                                    });
+                                }else{
+                                    this.setState({ startType: e.target.value },()=>{
+                                        this.projectTypeTabContent(this.state.projectType);
+                                    })
+                                }
                             }}
                         >
                           <Radio value={0}>外包(不走总部)</Radio>
@@ -5627,12 +5672,12 @@ const Task = React.createClass({
                       <Button
                           type="primary"
                           onClick={(e) => {
-                            if(this.state.projectType === 1 && this.state.patentType === -1){
+                            //this.state.startType   类型为外包时,当普通单
+                            if(this.state.projectType === 1 && this.state.patentType === -1 && this.state.startType === 1){
                               message.info('请先选择专利类型');
-                            }else if(this.state.projectType === 1 && this.state.patentNameType === -1){
+                            }else if(this.state.projectType === 1 && this.state.patentNameType === -1 && this.state.startType === 1){
                               message.info('请先选择专利名称');
-                            }
-                            else{
+                            } else{
                               this.addThirdList()
                             }
                           }}
@@ -5674,7 +5719,7 @@ const Task = React.createClass({
                     {/*如果是软著类或者专利类的专利申请,隐藏付款节点*/}
                     <div
                         style={{
-                          display: (this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block',  //0正常 1专利 2软著 3审计
+                          display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block'),  //0正常 1专利 2软著 3审计
                         }}
                     >
                     <span
@@ -5691,7 +5736,7 @@ const Task = React.createClass({
                             marginLeft: 10,
                             color: 'red',
                           }}
-                      ></span>
+                      />
                       <Button
                           type="primary"
                           onClick={(e) => {
@@ -5706,11 +5751,11 @@ const Task = React.createClass({
                         +新增付款节点
                       </Button>
                     </div>
-                    {/*如果是软著类或者专利类的专利申请,隐藏付款节点*/}
+                    {/*如果是软著类或者专利类的专利申请,隐藏付款节点但当为外包类型时,无需隐藏*/}
                     <div
                         className="clearfix"
                         style={{
-                          display: (this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block',  //0正常 1专利 2软著 3审计
+                          display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2? 'none' : 'block'),  //0正常 1专利 2软著 3审计
                         }}
                     >
                       <Spin spinning={this.state.loading}>
@@ -6048,7 +6093,7 @@ const Task = React.createClass({
             ThirdId={this.state.ThirdId}
             tid={this.state.tid}
             patentType={this.state.patentType}
-            projectType={this.state.projectType}
+            projectType={this.state.startType === 0 ? 0 : this.state.projectType}
             thirdCompanyName={this.state.thirdCompanyName}
             thirdUnitPrice={this.state.thirdUnitPrice}
             thirdQuantity={this.state.thirdQuantity}