Browse Source

专利模块优化

dev01 2 months ago
parent
commit
7ed6dbe50e

+ 21 - 16
src/pages/customerProfile/index.jsx

@@ -474,19 +474,19 @@ class CustomerProfile extends Component {
   // 计算专利总数
   countZlNum({ inventionPatentCount, utilityModelCount, appearancePatentCount, softwareWorksCount, otherCount }) {
     let count = 0;
-    if (inventionPatentCount && !isNaN(inventionPatentCount)) {
+    if (!isNaN(String(inventionPatentCount))) {
       count += Number(inventionPatentCount);
     }
-    if (utilityModelCount && !isNaN(utilityModelCount)) {
+    if (!isNaN(String(utilityModelCount))) {
       count += Number(utilityModelCount);
     }
-    if (appearancePatentCount && !isNaN(appearancePatentCount)) {
+    if (!isNaN(String(appearancePatentCount))) {
       count += Number(appearancePatentCount);
     }
-    if (softwareWorksCount && !isNaN(softwareWorksCount)) {
+    if (!isNaN(String(softwareWorksCount))) {
       count += Number(softwareWorksCount);
     }
-    if (otherCount && !isNaN(otherCount)) {
+    if (!isNaN(String(otherCount))) {
       count += Number(otherCount);
     }
     return count;
@@ -1347,11 +1347,11 @@ class CustomerProfile extends Component {
                                   info: {
                                     uid: this.$instance.router.params.id,
                                     id: dtails.id,
-                                    inventionPatentCount: dtails.inventionPatentCount || 0,
-                                    utilityModelCount: dtails.utilityModelCount || 0,
-                                    appearancePatentCount: dtails.appearancePatentCount || 0,
-                                    softwareWorksCount: dtails.softwareWorksCount || 0,
-                                    otherCount: dtails.otherCount || 0,
+                                    inventionPatentCount: dtails.inventionPatentCount || '',
+                                    utilityModelCount: dtails.utilityModelCount || '',
+                                    appearancePatentCount: dtails.appearancePatentCount || '',
+                                    softwareWorksCount: dtails.softwareWorksCount || '',
+                                    otherCount: dtails.otherCount || '',
                                   }
                                 })
                               }}
@@ -1359,12 +1359,12 @@ class CustomerProfile extends Component {
                           }
                         </View>
                         <View className="val">
-                          专利&nbsp;<Text className="num">{dtails.patentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
+                          专利&nbsp;<Text className="num">{dtails.patentCount}</Text>&nbsp;&nbsp;&nbsp;
                             其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             软著&nbsp;<Text className="num">{dtails.softwareWorksCount || ''}</Text>&nbsp;&nbsp;&nbsp;
-                            标准&nbsp;<Text className="num">{dtails.standard == 1 ? '有' : '无'}</Text>&nbsp;&nbsp;&nbsp;
+                            标准&nbsp;<Text className="num">{String(dtails.standard) === '1' ? '有' : String(dtails.standard) === '0' ? '无' : ''}</Text>&nbsp;&nbsp;&nbsp;
                             其他类型&nbsp;<Text className="num">{dtails.otherCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                         </View>
 
@@ -1791,14 +1791,19 @@ class CustomerProfile extends Component {
                 <View style={{ display: 'flex', margin: '12rpx 0' }}>
                   <Text style={{ fontSize: '32rpx', marginRight: '16rpx', width: '172rpx' }}>标准</Text>
                   <RadioGroup title="标准" onChange={e => {
-                    dtails.standard = Number(e.target.value);
-                    this.setState({ dtails });
+                    // dtails.standard = Number(e.target.value);
+                    // this.setState({ dtails });
+                    this.setState({
+                      info: Object.assign(info, {
+                        standard: Number(e.target.value),
+                      })
+                    })
                   }}>
                     <Label className='radio-list__label'>
-                      <Radio className='radio-list__radio' value={1} checked={dtails.standard == 1}>有</Radio>
+                      <Radio className='radio-list__radio' value={1} checked={String(dtails.standard) === '1'}>有</Radio>
                     </Label>
                     <Label className='radio-list__label'>
-                      <Radio className='radio-list__radio' value={0} checked={!dtails.standard}>无</Radio>
+                      <Radio className='radio-list__radio' value={0} checked={String(dtails.standard) === '0'}>无</Radio>
                     </Label>
                   </RadioGroup>
                 </View>

+ 10 - 4
src/pages/egressDetails/index.jsx

@@ -74,6 +74,7 @@ class EgressDetails extends Component {
       isSelFiles: false,
       filesList: [],
       uid: "",
+      prdid: "",
       // techStartProcess 	0无需审核 1需要审核 2营销审核通过 3营销审核驳回
       // assistProcess 		  0非协单 1协单上级未审核 2协单待审核 3协单部分审核 4协单完全审核 5协单驳回
       // assist 		        0非协单 1主协单 2子协单  3技术助手
@@ -448,6 +449,7 @@ class EgressDetails extends Component {
   }
 
   onSelFiles(data, type) {
+    console.log(data)
     let url = '';
     if (type == 1) {
       // 企业档案表
@@ -460,8 +462,9 @@ class EgressDetails extends Component {
     let userNames = data.userNames.split(",")
     let UserIds = data.uids.split(",")
     if (UserIds.length > 1) {
+      
       for (var i = 0; i < userNames.length; i++) {
-        list.push({ label: userNames[i], value: UserIds[i] })
+        list.push({ label: userNames[i], value: UserIds[i], prdid: data.prdList[i] ? data.prdList[i].id : '' })
       }
       this.setState({
         filesList: list,
@@ -600,7 +603,7 @@ class EgressDetails extends Component {
               <View className="value">
                 {/* {dtails.districtName} */}
                 {
-                  unique(dtails.prdList, "districtName")?.map((item, index) =>
+                  unique(JSON.parse(JSON.stringify(dtails.prdList || [])), "districtName")?.map((item, index) =>
                     <View key={index}>{item.districtName}</View>
                   )
                 }
@@ -1024,8 +1027,11 @@ class EgressDetails extends Component {
               options={this.state.filesList}
               value={this.state.uid}
               onClick={e => {
+                console.log(e)
+                let currFileItem = this.state.filesList.find(item => item.value == e);
                 this.setState({
-                  uid: e
+                  uid: e,
+                  prdid: currFileItem.prdid
                 })
               }}
             />
@@ -1043,7 +1049,7 @@ class EgressDetails extends Component {
                   isSelFiles: false
                 })
                 Taro.navigateTo({
-                  url: this.state.detailUrl + "?id=" + this.state.uid + "&notRequired=true&readonly=true",
+                  url: this.state.detailUrl + "?id=" + this.state.uid + "&notRequired=true&readonly=true&prdid="+this.state.prdid,
                 });
               }}>确定</Button>
           </AtModalAction>

+ 17 - 16
src/pages/interview/index.jsx

@@ -381,7 +381,7 @@ class CustomerProfile extends Component {
         message = '请输入面谈达成的目的,并且在20字以上';
         flag = false;
       } else {
-        if (this.state.dtails.interviewList.length) {
+        if (this.state.dtails.interviewList.length && !!this.state.dtails.interviewList[0].prdid) {
           if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
             message = '请输入面谈后的反馈,并且在20字以上';
             flag = false;
@@ -435,7 +435,7 @@ class CustomerProfile extends Component {
         message = '请输入经理/上级面谈建议,并且在20字以上';
         flag = false;
       } else {
-        if (this.state.dtails.interviewList.length) {
+        if (this.state.dtails.interviewList.length && !!this.state.dtails.interviewList[0].prdid) {
           if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
             message = '请输入面谈后的反馈,并且在20字以上';
             flag = false;
@@ -553,19 +553,20 @@ class CustomerProfile extends Component {
   // 计算专利总数
   countZlNum({ inventionPatentCount, utilityModelCount, appearancePatentCount, softwareWorksCount, otherCount }) {
     let count = 0;
-    if (inventionPatentCount && !isNaN(inventionPatentCount)) {
+    debugger
+    if (!isNaN(String(inventionPatentCount))) {
       count += Number(inventionPatentCount);
     }
-    if (utilityModelCount && !isNaN(utilityModelCount)) {
+    if (!isNaN(String(utilityModelCount))) {
       count += Number(utilityModelCount);
     }
-    if (appearancePatentCount && !isNaN(appearancePatentCount)) {
+    if (!isNaN(String(appearancePatentCount))) {
       count += Number(appearancePatentCount);
     }
-    if (softwareWorksCount && !isNaN(softwareWorksCount)) {
+    if (!isNaN(String(softwareWorksCount))) {
       count += Number(softwareWorksCount);
     }
-    if (otherCount && !isNaN(otherCount)) {
+    if (!isNaN(String(otherCount))) {
       count += Number(otherCount);
     }
     return count;
@@ -1577,11 +1578,11 @@ class CustomerProfile extends Component {
                                   info: {
                                     uid: this.props.customerList[this.props.interviewIdx].id,
                                     id: dtails.id,
-                                    inventionPatentCount: dtails.inventionPatentCount || 0,
-                                    utilityModelCount: dtails.utilityModelCount || 0,
-                                    appearancePatentCount: dtails.appearancePatentCount || 0,
-                                    softwareWorksCount: dtails.softwareWorksCount || 0,
-                                    otherCount: dtails.otherCount || 0,
+                                    inventionPatentCount: dtails.inventionPatentCount || '',
+                                    utilityModelCount: dtails.utilityModelCount || '',
+                                    appearancePatentCount: dtails.appearancePatentCount || '',
+                                    softwareWorksCount: dtails.softwareWorksCount || '',
+                                    otherCount: dtails.otherCount || '',
                                   }
                                 })
                               }}
@@ -1589,12 +1590,12 @@ class CustomerProfile extends Component {
                           }
                         </View>
                         <View className="val">
-                          专利&nbsp;<Text className="num">{dtails.patentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
+                          专利&nbsp;<Text className="num">{dtails.patentCount}</Text>&nbsp;&nbsp;&nbsp;
                             其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                             软著&nbsp;<Text className="num">{dtails.softwareWorksCount || ''}</Text>&nbsp;&nbsp;&nbsp;
-                            标准&nbsp;<Text className="num">{dtails.standard == 1 ? '有' : '无'}</Text>&nbsp;&nbsp;&nbsp;
+                            标准&nbsp;<Text className="num">{String(dtails.standard) === '1' ? '有' : String(dtails.standard) === '0' ? '无' : ''}</Text>&nbsp;&nbsp;&nbsp;
                             其他类型&nbsp;<Text className="num">{dtails.otherCount || ''}</Text>&nbsp;&nbsp;&nbsp;
                         </View>
 
@@ -1960,10 +1961,10 @@ class CustomerProfile extends Component {
                     this.setState({ dtails });
                   }}>
                     <Label className='radio-list__label'>
-                      <Radio className='radio-list__radio' value={1} checked={dtails.standard == 1}>有</Radio>
+                      <Radio className='radio-list__radio' value={1} checked={String(dtails.standard) === '1'}>有</Radio>
                     </Label>
                     <Label className='radio-list__label'>
-                      <Radio className='radio-list__radio' value={0} checked={!dtails.standard}>无</Radio>
+                      <Radio className='radio-list__radio' value={0} checked={String(dtails.standard) === '0'}>无</Radio>
                     </Label>
                   </RadioGroup>
                 </View>

+ 25 - 9
src/pages/interviewDetail/index.jsx

@@ -292,17 +292,37 @@ class CustomerProfile extends Component {
     };
   }
 
+  getInterviewData() {
+    getInterviewByPrdid({prdid: this.$instance.router.params.prdid}).then(res => {
+      if (res.error.length === 0) {
+        let defaultDetailData = this.state.dtails || {};
+        this.setState({
+          dtails: {
+            ...defaultDetailData,
+            earlyCommunication: res.data.data.earlyCommunication,
+            customerDemand: res.data.data.customerDemand,
+            interviewIdeas: res.data.data.interviewIdeas,
+            interviewPurpose: res.data.data.interviewPurpose,
+            interviewRecommend: res.data.data.interviewRecommend,
+            interviewFeedback: res.data.data.interviewFeedback,
+            followUpPlan: res.data.data.followUpPlan,
+            interviewList: res.data.list,
+          }
+        });
+      }
+    })
+  }
+
   // 客户档案详情
   queryByUidAll() {
     const id = this.$instance.router.params.id;
-    // getInterviewByPrdid({prdid: this.$instance.router.params.prdid})
     queryByUidAll(
       true,
       { id }
     )
       .then((v) => {
         if (v.error.length === 0) {
-
+          
           let dtailsData = {
             ...v.data,
             companyCount: this.addCommas(v.data.companyCount || 0),
@@ -313,17 +333,13 @@ class CustomerProfile extends Component {
             financialProperty: this.addCommas(v.data.financialProperty || 0),
             financialRd: this.addCommas(v.data.financialRd || 0),
             enterpriseCount: this.addCommas(v.data.enterpriseCount || 0),
-            earlyCommunication: v.data.interviewList.length ? v.data.interviewList[0].earlyCommunication : '',
-            customerDemand: v.data.interviewList.length ? v.data.interviewList[0].customerDemand : '',
-            interviewIdeas: v.data.interviewList.length ? v.data.interviewList[0].interviewIdeas : '',
-            interviewPurpose: v.data.interviewList.length ? v.data.interviewList[0].interviewPurpose : '',
-            interviewRecommend: v.data.interviewList.length ? v.data.interviewList[0].interviewRecommend : '',
-            interviewFeedback: v.data.interviewList.length ? v.data.interviewList[0].interviewFeedback : '',
-            followUpPlan: v.data.interviewList.length ? v.data.interviewList[0].followUpPlan : '',
+           
           }
           let patentCount = this.countZlNum(dtailsData);
           this.setState({
             dtails: { ...dtailsData, patentCount }
+          }, () => {
+            this.getInterviewData();
           });
         } else {
           setTimeout(() => {