雷佳斌 1 週間 前
コミット
c8f5d306c9

+ 3 - 2
src/components/common/CustomerProjectSelect/index.less

@@ -27,7 +27,8 @@
   }
 
 .add-btn {
-    height: 56rpx;
-    line-height: 52rpx;
+    height: 30PX;
+    line-height: 28PX;
+    padding: 0 10PX;
     font-size: 25rpx;
 }

+ 9 - 1
src/components/common/addressPicker/index.jsx

@@ -1,5 +1,4 @@
 import React, { Component } from "react";
-import Taro from '@tarojs/taro'
 import { View, PickerView, PickerViewColumn } from '@tarojs/components'
 import PropTypes from 'prop-types'
 import address from '../../../utils/tools/city.js'
@@ -24,6 +23,15 @@ class AddressPicker extends Component {
     this.cityChange = this.cityChange.bind(this);
   }
 
+  componentDidUpdate(prevProps) {
+    console.log(this.props.value)
+    if (!!this.props.value && !!prevProps.value && this.props.value instanceof Array && prevProps.value instanceof Array) {
+      if (this.props.value.join(',') != prevProps.value.join(',')) {
+        this.setState({ value: this.props.value });
+      }
+    }
+  }
+
   cityChange(e) {
     const { provinces, citys, value } = this.state
     const pickerValue = e.detail.value

+ 30 - 14
src/pages/customerProfile/index.jsx

@@ -87,7 +87,9 @@ class CustomerProfile extends Component {
       interactList: [],
 
       checkCompShow: false,
-      checkCompList: []
+      checkCompList: [],
+
+      currAddress: []
     };
     this.queryByUidAll = this.queryByUidAll.bind(this);
     this.update = this.update.bind(this);
@@ -819,7 +821,7 @@ class CustomerProfile extends Component {
       // 会员项目
       if (data.buyStatus == 1) {
         name = name + `(新购)`;
-      } else if (data.buyStatus == 2) { } {
+      } else if (data.buyStatus == 2) {
         name = name + `(复购${data.buyStatusOther})`;
       }
     } else if (!!data.examineStatus) {
@@ -905,7 +907,14 @@ class CustomerProfile extends Component {
                         <View className="item-title">企业所在地省市区:</View>
                         <View className="item-value">
 
-                          <View className="link" onClick={() => { this.setState({ addressPickerShow: true }) }}>
+                          <View className="link" onClick={() => {
+                            let currAddress = [];
+                            console.log(dtails.locationProvince, dtails.locationCity, dtails.locationArea)
+                            if (dtails.locationProvince && dtails.locationCity && dtails.locationArea) {
+                              currAddress = [dtails.locationProvince, dtails.locationCity, dtails.locationArea];
+                            }
+                            this.setState({ addressPickerShow: true, currAddress })
+                          }}>
                             {dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : '请选择'}
                           </View>
 
@@ -1034,7 +1043,13 @@ class CustomerProfile extends Component {
                       <View className="item">
                         <View className="item-title">企业所在地省市区:</View>
                         <View className="item-value">
-                          <View className="link" onClick={() => { this.setState({ addressPickerShow: true }) }}>
+                          <View className="link" onClick={() => {
+                            let currAddress = [];
+                            if (!dtails.locationProvince && !dtails.locationCity && !dtails.locationArea) {
+                              currAddress = [dtails.locationProvince, dtails.locationCity, dtails.locationArea];
+                            }
+                            this.setState({ addressPickerShow: true, currAddress })
+                          }}>
                             {dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : '请选择'}
                           </View>
                         </View>
@@ -1197,19 +1212,19 @@ class CustomerProfile extends Component {
                       <View style={{ marginTop: '40rpx' }}>
                         <View className="title">企业情况</View>
                         <View className="tit" style={{ margin: '32rpx 0 20rpx;'}}>
-                          <Text>
+                        <Text>
                             1.知识产权情况
-                                {/* <Text className="txt">(专利信息、标准、专利、软著)</Text> */}
+                            <Text className="txt">(专利信息、标准、专利、软著)</Text>
                           </Text>
-                          {/* {
+                          {
                             dtails.myUser == 1 &&
                             <View className="up"
-                            onClick={e => {
+                              onClick={e => {
                                 e.stopPropagation()
                                 this.setState({
-                                upType: 1,
-                                isOpened: true,
-                                info: {
+                                  upType: 1,
+                                  isOpened: true,
+                                  info: {
                                     uid: this.$instance.router.params.id,
                                     id: dtails.id,
                                     inventionPatentCount: dtails.inventionPatentCount || 0,
@@ -1217,11 +1232,11 @@ class CustomerProfile extends Component {
                                     appearancePatentCount: dtails.appearancePatentCount || 0,
                                     softwareWorksCount: dtails.softwareWorksCount || 0,
                                     otherCount: dtails.otherCount || 0,
-                                }
+                                  }
                                 })
-                            }}
+                              }}
                             >修改</View>
-                        } */}
+                          }
                         </View>
                         <View className="val">
                           专利&nbsp;<Text className="num">{dtails.patentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
@@ -2067,6 +2082,7 @@ class CustomerProfile extends Component {
 
         {/* 省市区选择器 */}
         <AddressPicker
+          value={this.state.currAddress}
           pickerShow={this.state.addressPickerShow}
           onHandleToggleShow={this.toggleAddressPicker.bind(this)}
         />

+ 12 - 6
src/pages/customerProfile/index.less

@@ -111,13 +111,15 @@
         margin-bottom: 5px;
 
         .up {
-          background: #70B603;
-          color: #FFFFFF;
-          padding: 10px 20px;
-          font-size: 26px;
-          border-radius: 8px;
+          // background: #70B603;
+          // color: #FFFFFF;
+          // padding: 10px 20px;
+          // font-size: 26px;
+          // border-radius: 8px;
+          // font-weight: 400;
           font-weight: 400;
-
+          color: #3864ef;
+          font-size: 26rpx;
         }
 
         .txt {
@@ -411,3 +413,7 @@
     }
   }
 }
+
+.at-input::after {
+  display: none;
+}

+ 6 - 5
src/pages/interview/components/InteractList.jsx

@@ -4,6 +4,7 @@ import { AtFloatLayout, AtTimeline } from "taro-ui";
 
 import 'taro-ui/dist/style/components/float-layout.scss';
 import 'taro-ui/dist/style/components/button.scss';
+import './index.less';
 
 
 class InteractList extends Component {
@@ -25,11 +26,11 @@ class InteractList extends Component {
     })
     return (
         <AtFloatLayout isOpened={this.props.isOpened} title={this.props.title} scrollY onClose={this.handleClose}>
-            <AtTimeline 
-                pending 
-                items={hisItems}
-            >
-            </AtTimeline>
+          <AtTimeline 
+              pending 
+              items={hisItems}
+          >
+          </AtTimeline>
         </AtFloatLayout>
     )
   }

+ 13 - 0
src/pages/interview/components/index.less

@@ -0,0 +1,13 @@
+.at-timeline-item {
+  padding-bottom: 36rpx;
+}
+.at-timeline-item__content-item {
+  color: #333;
+  font-weight: 600;
+}
+.at-timeline-item__content--sub {
+  color: #999;
+  margin-top: 8rpx;
+  font-size: 25rpx;
+  font-weight: 400;
+}

+ 34 - 18
src/pages/interview/index.jsx

@@ -250,7 +250,7 @@ class CustomerProfile extends Component {
     this.limitUser();
     return {
       title: "客户档案",
-      path: "/pages/customerProfile/index?id=" + this.$instance.router.params.id,
+      path: "/pages/customerProfile/index?id=" + this.props.customerList[this.props.interviewIdx].id,
     };
   }
 
@@ -567,8 +567,9 @@ class CustomerProfile extends Component {
     }
   }
   postAddProject() {
-    const { checkProject, dtails, info } = this.state;
+    const { checkProject, dtails, info, projectList } = this.state;
     const params = { uid: dtails.uid };
+
     if (!checkProject.length) {
       Taro.showToast({
         title: "请选择要添加的项目",
@@ -576,6 +577,15 @@ class CustomerProfile extends Component {
       });
       return;
     } else {
+      let isAdded = projectList.some(item => item.pid == checkProject[0].id)
+      if (isAdded) {
+        Taro.showToast({
+          title: checkProject[0].bname + '已存在,请勿重复添加!',
+          icon: "none",
+        });
+        return false;
+      }
+
       params.pid = checkProject[0].id;
       if (checkProject[0].cSort == 9) {
         if (!info.examineStatus) {
@@ -628,7 +638,7 @@ class CustomerProfile extends Component {
         this.getProjectList();
       } else {
         Taro.showToast({
-          title: v.error[0].message,
+          title: res.error[0].message,
           icon: "none"
         });
       }
@@ -667,6 +677,7 @@ class CustomerProfile extends Component {
   // 新建联系人
   add() {
     let data = this.state.obj
+    console.log(data)
     for (let i in data) {
       if (!data[i] && data[i] !== 0) {
         Taro.showToast({
@@ -742,7 +753,7 @@ class CustomerProfile extends Component {
 
   getUserList() {
     findCustomerContacts({
-      uid: this.$instance.router.params.id,
+      uid: this.props.customerList[this.props.interviewIdx].id,
     })
       .then((v) => {
         if (v.error.length === 0) {
@@ -760,7 +771,7 @@ class CustomerProfile extends Component {
 
   updateMainContact(id) {
     updateMainContact({
-      uid: this.$instance.router.params.id,
+      uid: this.props.customerList[this.props.interviewIdx].id,
       ocbId: id,
     }).then((v) => {
       if (v.error.length === 0) {
@@ -781,7 +792,7 @@ class CustomerProfile extends Component {
 
   limitUser() {
     limitUser({
-      uid: this.$instance.router.params.id,
+      uid: this.props.customerList[this.props.interviewIdx].id,
       // hours: 1,
     }).then((v) => {
       if (v.error.length === 0) {
@@ -876,16 +887,16 @@ class CustomerProfile extends Component {
     let name = data.name;
     if (!!data.buyStatus) {
       // 会员项目
-      if (data.buyStatus == 1) {
+      if (data.buyStatus === 1) {
         name = name + `(新购)`;
-      } else if (data.buyStatus == 2) { } {
+      } else if (data.buyStatus === 2) {
         name = name + `(复购${data.buyStatusOther})`;
       }
     } else if (!!data.examineStatus) {
       // 高新项目
-      if (data.examineStatus == 1) {
+      if (data.examineStatus === 1) {
         name = name + `(初次审核)`;
-      } else if (data.examineStatus == 2) {
+      } else if (data.examineStatus === 2) {
         name = name + `(${data.examineStatusOther}年复审)`;
       }
     }
@@ -945,7 +956,7 @@ class CustomerProfile extends Component {
                     onClick={e => {
                       e.stopPropagation()
                       Taro.navigateTo({
-                        url: "/pages/situation/index?id=" + this.$instance.router.params.id + "&notRequired=" + this.$instance.router.params.notRequired,
+                        url: "/pages/situation/index?id=" + this.props.customerList[this.props.interviewIdx].id + "&notRequired=" + this.$instance.router.params.notRequired,
                       });
                     }}
                   >公出记录</View>
@@ -1040,7 +1051,7 @@ class CustomerProfile extends Component {
                                 this.setState({
                                   isAdd: true,
                                   obj: {
-                                    uid: this.$instance.router.params.id,
+                                    uid: this.props.customerList[this.props.interviewIdx].id,
                                     name: "",
                                     position: "",
                                     department: "",
@@ -1048,7 +1059,9 @@ class CustomerProfile extends Component {
                                   }
                                 })
                               }}
-                            >新增</View>
+                            >
+                              新增
+                            </View>
                           }
                         </View>
                         <View className="item-value">
@@ -1073,7 +1086,7 @@ class CustomerProfile extends Component {
                                   upType: 5,
                                   isOpened: true,
                                   info: {
-                                    uid: this.$instance.router.params.id,
+                                    uid: this.props.customerList[this.props.interviewIdx].id,
                                     intendedProject: dtails.intendedProject,
                                   },
                                   checkOptions: []
@@ -1089,7 +1102,9 @@ class CustomerProfile extends Component {
                                 <Text style={{ fontSize: '30rpx' }} style={{ marginRight: '10rpx' }}>
                                   {this.renderProjectItemName(item)}
                                 </Text>
-                                <AtIcon value="close" size='15' color="#f00" onClick={() => { this.handleDelProject(item) }} />
+
+                                { item.type == 0 && <AtIcon value="close" size='15' color="#f00" onClick={() => { this.handleDelProject(item) }} /> }
+                                
                               </View>
                             })
                           }
@@ -1356,7 +1371,7 @@ class CustomerProfile extends Component {
                                 this.setState({
                                   isAdd: true,
                                   obj: {
-                                    uid: this.$instance.router.params.id,
+                                    uid: this.props.customerList[this.props.interviewIdx].id,
                                     name: "",
                                     position: "",
                                     department: "",
@@ -1394,7 +1409,7 @@ class CustomerProfile extends Component {
                                   upType: 5,
                                   isOpened: true,
                                   info: {
-                                    uid: this.$instance.router.params.id,
+                                    uid: this.props.customerList[this.props.interviewIdx].id,
                                     intendedProject: dtails.intendedProject,
                                   },
                                   checkOptions: []
@@ -1433,7 +1448,7 @@ class CustomerProfile extends Component {
                                   upType: 1,
                                   isOpened: true,
                                   info: {
-                                    uid: this.$instance.router.params.id,
+                                    uid: this.props.customerList[this.props.interviewIdx].id,
                                     id: dtails.id,
                                     inventionPatentCount: dtails.inventionPatentCount || 0,
                                     utilityModelCount: dtails.utilityModelCount || 0,
@@ -1994,6 +2009,7 @@ class CustomerProfile extends Component {
               placeholder='请填写部门'
               value={obj.department}
               onChange={e => {
+                console.log(e)
                 this.setState({
                   obj: Object.assign(obj, {
                     department: e,

+ 13 - 6
src/pages/interview/index.less

@@ -111,12 +111,15 @@
         margin-bottom: 5px;
 
         .up {
-          background: #70B603;
-          color: #FFFFFF;
-          padding: 10px 20px;
-          font-size: 26px;
-          border-radius: 8px;
+          // background: #70B603;
+          // color: #FFFFFF;
+          // padding: 10px 20px;
+          // font-size: 26px;
+          // border-radius: 8px;
+          // font-weight: 400;
           font-weight: 400;
+          color: #3864ef;
+          font-size: 26rpx;
 
         }
 
@@ -410,4 +413,8 @@
       color: #767272;
     }
   }
-}
+}
+
+.at-input::after {
+  display: none;
+}